Skip to content

Instantly share code, notes, and snippets.

@blackrez
Created November 21, 2024 14:11
Show Gist options
  • Select an option

  • Save blackrez/8b5ff94e081fe68c7811deb8c9e44079 to your computer and use it in GitHub Desktop.

Select an option

Save blackrez/8b5ff94e081fe68c7811deb8c9e44079 to your computer and use it in GitHub Desktop.
sources:
generate_syslog:
type: "demo_logs"
format: "syslog"
count: 100
transforms:
remap_syslog:
inputs:
- "generate_syslog"
type: "remap"
source: |
structured = parse_syslog!(.message)
. = merge(., structured)
.doc = .
.doc_as_upsert = true
.msgid = sha1("foo")
sinks:
emit_syslog:
inputs:
- "remap_syslog"
type: "console"
encoding:
codec: "json"
sink_elastic:
type: "elasticsearch"
mode: bulk
inputs:
- "remap_syslog"
endpoint: http://localhost:9200/
bulk:
action : update
encoding:
only_fields:
- "doc"
- "doc_as_upsert"
id_key:
msgid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment