Skip to content

Instantly share code, notes, and snippets.

@ijokarumawak
Last active February 15, 2022 10:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ijokarumawak/67877a3c09b350cbadf653b70a522301 to your computer and use it in GitHub Desktop.
Save ijokarumawak/67877a3c09b350cbadf653b70a522301 to your computer and use it in GitHub Desktop.
README.md

Simplest Filebeat config to test processors

This filebeat.yml config will receive input from stdout, do some processing and write output to stdout.

How to run

echo "message" | filebeat -c `pwd`/filebeat.yml -e 2> /dev/null

Output example

{
  "@timestamp": "2021-03-16T06:33:41.449Z",
  "@metadata": {
    "beat": "filebeat",
    "type": "_doc",
    "version": "7.9.0"
  },
  "input": {
    "type": "stdin"
  },
  "host": {
    "name": "xxx"
  },
  "agent": {
    "type": "filebeat",
    "version": "7.9.0",
  },
  "ecs": {
    "version": "1.5.0"
  },
  "example": {
    "key1": "val1",
    "key2": "val2"
  },
  "log": {
    "offset": 0,
    "file": {
      "path": ""
    }
  },
  "message": "message"
}

logging.level: error
filebeat.inputs:
- type: stdin
processors:
- add_fields:
target: example
fields:
key1: val1
key2: val2
output.console:
pretty: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment