Skip to content

Instantly share code, notes, and snippets.

@jsvd
Created January 15, 2021 11:14
Show Gist options
  • Save jsvd/1db73cd4c4d0fccc76086ac27bb75979 to your computer and use it in GitHub Desktop.
Save jsvd/1db73cd4c4d0fccc76086ac27bb75979 to your computer and use it in GitHub Desktop.
/tmp/logstash-7.10.1
❯ cat cfg
input {
generator {
codec => json
message => '{"systat": {"start": {"timestamp": {"timesecs": 10}}, "intervals": {"streams": {"end": 10}}}}'
count => 1
}
}
filter {
ruby {
code => 'event.set("[systat][start][timestamp][timesecsunix]", [ event.get("[systat][start][timestamp][timesecs]")+ event.get("[systat][intervals][streams][end]") ] )'
}
}
output {stdout {} }
/tmp/logstash-7.10.1
❯ bin/logstash -f cfg
Using JAVA_HOME defined java: /Users/joaoduarte/.jenv/versions/1.8
WARNING, using JAVA_HOME while Logstash distribution comes with a bundled JDK
Sending Logstash logs to /tmp/logstash-7.10.1/logs which is now configured via log4j2.properties
[2021-01-15T11:13:50,852][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.10.1", "jruby.version"=>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc OpenJDK 64-Bit Server VM 25.232-b09 on 1.8.0_232-b09 +indy +jit [darwin-x86_64]"}
[2021-01-15T11:13:51,059][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2021-01-15T11:13:52,504][INFO ][org.reflections.Reflections] Reflections took 32 ms to scan 1 urls, producing 23 keys and 47 values
[2021-01-15T11:13:53,825][INFO ][logstash.javapipeline ][main] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>8, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>1000, "pipeline.sources"=>["/private/tmp/logstash-7.10.1/cfg"], :thread=>"#<Thread:0xcbcb885 run>"}
[2021-01-15T11:13:54,487][INFO ][logstash.javapipeline ][main] Pipeline Java execution initialization time {"seconds"=>0.65}
[2021-01-15T11:13:54,512][INFO ][logstash.javapipeline ][main] Pipeline started {"pipeline.id"=>"main"}
[2021-01-15T11:13:54,573][INFO ][logstash.agent ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2021-01-15T11:13:54,983][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
{
"systat" => {
"start" => {
"timestamp" => {
"timesecs" => 10,
"timesecsunix" => [
[0] 20
]
}
},
"intervals" => {
"streams" => {
"end" => 10
}
}
},
"sequence" => 0,
"@version" => "1",
"@timestamp" => 2021-01-15T11:13:54.620Z,
"host" => "joaos-mbp.lan"
}
[2021-01-15T11:13:55,193][INFO ][logstash.javapipeline ][main] Pipeline terminated {"pipeline.id"=>"main"}
[2021-01-15T11:13:55,665][INFO ][logstash.pipelinesregistry] Removed pipeline from registry successfully {:pipeline_id=>:main}
[2021-01-15T11:13:55,711][INFO ][logstash.runner ] Logstash shut down.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment