elastic/logstash

Create 'exec' filter

Open

#2.528 geöffnet am 6. Feb. 2015

Auf GitHub ansehen
 (1 Kommentar) (1 Reaktion) (0 zugewiesene Personen)Ruby (3.496 Forks)batch import
help wantednew plugin

Repository-Metriken

Stars
 (14.197 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 2T 22h) (75 gemergte PRs in 30 T)

Beschreibung

Migrated from https://logstash.jira.com/browse/LOGSTASH-119:

Would be useful to pipe arbitrary fields through a command to modify them.

Here's an example that would anonymize hostnames or something.

filter {
  exec {
    command => "sed -re 's/\S+\.loggly\.com/anonymizedhost.example.com/'"
    fields => [ "@message", "hostname", "@source_host" ]
  }
}

The default would use only the message to parse

The protocol between logstash and the exec filter must be strict. Something like: for every line emitted, one line must be emitted as the 'new' line. If no changes are made, simply print it unmodified.

deleting the field can be done by printing a blank line

we exec the process once and use stdin for sending data, stdout for reading responses; if it dies, some retries should occur

Contributor Guide