GithubHelp home page GithubHelp logo

docker-grok_exporter's Introduction

grok_exporter

Export Prometheus metrics from arbitrary unstructured log data.

About Grok

Grok is a tool to parse crappy unstructured log data into something structured and queryable.

The [grok_exporter] aims at porting Grok from the ELK stack to Prometheus monitoring. The goal is to use Grok patterns for extracting Prometheus metrics from arbitrary log files.

How to use this image

You need to provide [grok_exporter] with a config file in order to function properly. For more information on proper configuration of grok_exporter please refer to its documentation.

There are various ways in which you can utilize this image, each however assumes that the log file you're trying to parse is reacheable by the grok_exporter container.

Running Solo

This assumes Prometheus is installed locally (or on another server) and therefore, the metrics endpoint that grok_exporter exposes must be reachable:

docker container run --name grok -d \
                     -p PORT:PORT \
                     -v $(pwd)/config.yml:/etc/grok_exporter/config.yml \
                     palobo/grok_exporter
  • PORT is the port defined in config file (default is 9144

Docker Compose Setup

Assuming you're using this image alonside other images (Prometheus and Grafana running in containers too), then the is slightly different since there is no need to expose the ports externally.

docker container run --name grok -d \
                     --net PROM-NETWORK \
                     -v $(pwd)/config.yml:/etc/grok_exporter/config.yml \
                     palobo/grok_exporter

Example Config

Refer to the grok_exporter documentation for all the details on how to properly configure it.

global:
    config_version: 2
input:
    type: file
    path: ./example/example.log
    readall: true
grok:
    patterns_dir: ./logstash-patterns-core/patterns
metrics:
    - type: counter
      name: grok_example_lines_total
      help: Counter metric example with labels.
      match: '%{DATE} %{TIME} %{USER:user} %{NUMBER}'
      labels:
          user: '{{.user}}'
server:
    port: 9144

docker-grok_exporter's People

Contributors

pslobo avatar

Watchers

James Cloos 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.