Skip to content

Instantly share code, notes, and snippets.

@andrewvc
Last active October 27, 2017 21:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewvc/1b6e5c72cf124ed39d311f9714dac271 to your computer and use it in GitHub Desktop.
Save andrewvc/1b6e5c72cf124ed39d311f9714dac271 to your computer and use it in GitHub Desktop.
input { generator {} }
filter {
ruby {
# Add a \t (tab) by using its ASCII code (9)
code => 'event.set("message", 9.chr + event.get("message"))'
}
ruby {
# Make a new field with the tab removed
code => 'event.set("tabless", event.get("message").gsub(9.chr, ""))'
}
}
output { stdout { codec => rubydebug {} } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment