Giter Site home page Giter Site logo

ail-feeder-jsonlogs's Introduction

AIL -feeder from JSON

Aggregate json log lines and push to AIL

This AIL feeder is a generic software to feed JSON logs lines stored in a folder to AIL.

Installation

On a debian/ubuntu launch ./setup.sh

Usage

  • first activate virtualenv: . ./venv/bin/activate

  • then use:

(venv) ➜  ail-feeder-jsonlogs git:(main) ✗ ./bin/jsonfeeder.py --h
usage: jsonfeeder.py [-h] [--dry]

optional arguments:
  -h, --help  show this help message and exit
  --dry       dry run - output to stdout
(venv) ➜  ail-feeder-jsonlogs git:(main) ✗ 

Configuration

[ail]
url = https://127.0.0.1:7020/api/v1/import/json/item
apikey = <YOURAPIKEY>
ailfeedertype = 
# use uuidgen
uuid = 

[folder]
# basedir is the logs root folder
basedir = .
# a prefix can be prepended
prefix =
# a suffix can be appended
suffix =
# Leave datapattern empty to inspect all basedir's subfolders
datepattern =
# Set datepattern to a date pattern if you need a daily output
# an instance with datepattern = %Y%m%d on the 12/10/2020 will
# look into basedir/prefix20201012suffix
# datepattern follows 1989 C standard

# selector follows jmespath grammar
# it should follow the multi-select hash spec
# add u_ in front of keys to have these set together as keyid (this will be unique per exec)
# for instance sending only one line to AIL for several client requests on a webserver would look like that:
[selector]
selector = "{u_request: request , u_remote_ip: ip, time: time}"

[input]
encoding = utf-8

JSON output format to AIL

  • source is the name of the AIL json feeder module
  • source-uuid is the UUID of the feeder (unique per feeder)
  • data is the JSON data
  • data-sha256 is the SHA256 value JSON data

ail_feeder_jsonlogs

{
    "data": {
        "host": "example.com",
        "remote_ip": "127.0.0.1",
        "time": "31/Aug/2020:15:15:13 +0200"
    },
    "data-sha256": "1650da45f2480a5bb95e40b1306280157f5efd9d71fe2858d1b1879969d6d41f",
    "default-encoding": "UTF-8",
    "source": "my_ail_feeder",
    "source-uuid": "c0e2aa8a-7b41-4156-803e-ec5f364b4a1e"
}

ail-feeder-jsonlogs's People

Contributors

gallypette avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  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.