Skip to content

Instantly share code, notes, and snippets.

@bfritz
Created July 22, 2014 11:49
Show Gist options
  • Save bfritz/3eec6a6fb3dc97afa541 to your computer and use it in GitHub Desktop.
Save bfritz/3eec6a6fb3dc97afa541 to your computer and use it in GitHub Desktop.
logstash ruby date range tagging for backfill
filter {
ruby {
init => 'AFTER_EVENT = LogStash::Event.new; AFTER_EVENT.timestamp="2014-06-30T23:59:59.748Z"; BEFORE_EVENT = LogStash::Event.new; BEFORE_EVENT.timestamp="2014-07-22T02:01:56.000Z"'
code => 'if event.unix_timestamp > AFTER_EVENT.unix_timestamp && event.unix_timestamp < BEFORE_EVENT.unix_timestamp then event.tags.push("backfill") end'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment