Code Monkey home page Code Monkey logo

nginxlog's Introduction

nginxlog

Golang解析nginx日志,存入elasticsearch

usage

  • 进入conf目录下将conf.toml.example重命名为conf.toml并完成配置信息
[app]
port = ":8090"
pprof = "8091"
debug = true

[elastic]
elastic_url = "elasticsearch地址"
elastic_index = "elasticsearch index"
elastic_type = "elasticsearch type"
elastic_log_path = "./logs"
elastic_log_max_files = 5

[log]
target_path = "日志目录"
tartet_file_prefix = "默认日志文件前缀名称"
  • 编译为可执行文件: go build -o agent agent.go,然后加入path目录,执行agent即可

router

//状态码查询
api/analysis/status?status=[status]&per_page=[per_page]&page=[page]
//请求方法查询
api/analysis/method?method=[method]&per_page=[per_page]&page=[page]
//top ip访问查询
api/analysis/topIp

script

  • division_log.py 日志文件5分钟分割一次

nginxlog's People

Contributors

markbest avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

zhangyuqiang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.