Giter Site home page Giter Site logo

falcon-log-agent's Introduction

falcon-log-agent

Synopsis

Falcon-Log-Agent is an open-source log collection tool designed to crawl and log feature information from streaming logs.

The acquired feature information is associated with the open source Open-Falcon monitoring system. It can be used for measuring business indicators and for building stability.

Highlights

  • Powerful and flexible
  • Calculating with high efficiency
  • Friendly strategy configuration supporting secondary development
  • Support for a variety of computing methods(cnt、avg、sum、max、min etc.)
  • Development language: entire agent written in Golang

Data Model

The data model is similar to the data model in Open-Falcon: metric and endpoint with a couple of key value tags. Here are two examples:

{
    metric: load.1min,
    endpoint: open-falcon-host,
    tags: srv=falcon,idc=aws-sgp,group=az1,
    value: 1.5,
    timestamp: `date +%s`,
    counterType: GAUGE,
    step: 60
}
{
    metric: net.port.listen,
    endpoint: open-falcon-host,
    tags: port=3306,
    value: 1,
    timestamp: `date +%s`,
    counterType: GAUGE,
    step: 60
}

Geting Started

clone & build

git clone https://github.com/didi/falcon-log-agent.git && cd falcon-log-agent && sh build.sh

change configs

# base config
cp cfg/dev.cfg cfg/cfg.json
vim cfg/cfg.json

# strategy config
cp cfg/strategy.dev.json cfg/strategy.json
vim cfg/strategy.json

start & stop & status service

 # start
./control start

# stop
./control stop

# status
./control status

BasicConfig

{
	# configs about log
    "log" : {
        "log_path" : "/var/log/log-agent",
        "log_level" : "INFO",
        "log_rotate_size" : 200,
        "log_rotate_num" : 10
    },

    # configs about service
    "http" : {
        "http_port" : 8003
    },

    # configs about strategy & update
    "strategy" : {
        "update_duration" : 60,
        "default_degree" : 6
    },

    # configs about worker
    "worker" : {
        "worker_num" : 10,
        "queue_size" : 1024000,
        "push_interval" : 1,
        "push_url" : "http://127.0.0.1:1988/v1/push"
    },

    # configs about resource self-limited
    "max_cpu_rate": 0.2,
    "max_mem_rate": 0.05
}

StrategyConfig

[
    {
        "id":1,
        "name":"流量500错误数",
        "file_path":"/home/work/myService/log/access.log",
        "time_format":"dd/mmm/yyyy:HH:MM:SS",
        "pattern":"service error 500, num=(\\d+)",
        "exclude":"unimport-request",
        "step":10,
        "tags":{
            "provice" : "province=(\\s+)"
        },
        "func":"cnt",
        "degree":6,
        "comment":"i'm comment"
    }
]

Support TimeFormat List

  • dd/mmm/yyyy:HH:MM:SS
  • dd/mmm/yyyy HH:MM:SS
  • yyyy-mm-ddTHH:MM:SS
  • dd-mmm-yyyy HH:MM:SS
  • yyyy-mm-dd HH:MM:SS
  • yyyy/mm/dd HH:MM:SS
  • yyyymmdd HH:MM:SS
  • mmm dd HH:MM:SS

And you can also add timeFormat in src/common/utils/util.go

falcon-log-agent's People

Contributors

gaojiasheng avatar 1feng avatar

Watchers

 avatar  avatar

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.