Skip to content

Instantly share code, notes, and snippets.

@sospartan
Created March 13, 2020 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sospartan/6c6b1072703fd5fe11318a99dfaee8eb to your computer and use it in GitHub Desktop.
Save sospartan/6c6b1072703fd5fe11318a99dfaee8eb to your computer and use it in GitHub Desktop.
logstash config to replay day by day
input {
generator {
lines => [
"recap"
]
count => 1
}
}
filter {
ruby {
code => "
require 'time'
dates=*(Date.new(2019, 07, 01)..Date.today())
dates.each { |x| x.strftime('%Y-%m-%d') }
event.set('message', dates.join(','));
"
}
split {
field => "message"
terminator => ","
}
}
output {
stdout {codec => json_lines}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment