My part of final config looks like this:
grok {
overwrite => ["message"]
match => { "message" => "%{TIMESTAMP_ISO8601:Local_Timestamp}" }
}
ruby {
init => "require 'date'"
code => "temp = DateTime.strptime(event.get('Local_Timestamp'), '%Y-%m-%dT%H:%M:%S.%N%:z')
temp = temp.new_offset(0)
event.set('Local_Timestamp') = temp.strftime('%FT%T.%6N%:z')
"
}
From looking at the logstash logs, it does not look like it throws any errors, but just keeps looping through startup. No messages are processed and inserted into Elastic Search with this config. As soon as I take away the ruby, things go back to normal.
Here are some of the logs I am getting:
[2017-09-18T16:56:11,954][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://elastic:xxxxxx@192.168.1.233:9200/, :path=>"/"}
[2017-09-18T16:56:11,960][INFO ][logstash.inputs.udp ] UDP listener started {:address=>"0.0.0.0:1514", :receive_buffer_bytes=>"106496", :queue_size=>"2000"}
[2017-09-18T16:56:11,987][WARN ][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>#<URI::HTTP:0x2602804b URL:http://elastic:xxxxxx@192.168.1.233:9200/>}
[2017-09-18T16:56:11,988][INFO ][logstash.outputs.elasticsearch] Using mapping template from {:path=>nil}
[2017-09-18T16:56:12,029][INFO ][logstash.outputs.elasticsearch] Attempting to install template {:manage_template=>{"template"=>"logstash-*", "version"=>50001, "settings"=>{"index.refresh_interval"=>"5s"}, "mappings"=>{"_default_"=>{"_a$
[2017-09-18T16:56:12,032][INFO ][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>[#<URI::Generic:0x35ea56d9 URL://192.168.1.233:9200>]}
[2017-09-18T16:56:12,103][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2017-09-18T16:57:31,695][INFO ][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://logstash_system:xxxxxx@localhost:9200/_xpack/monitoring/?system_id=logstash&system_api_version=2&$
[2017-09-18T16:57:31,699][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://logstash_system:xxxxxx@localhost:9200/, :path=>"/"}
[2017-09-18T16:57:31,810][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>#<URI::HTTP:0x34f162c9 URL:http://logstash_system:xxxxxx@localhost:9200/_xpack/monitoring/?$
[2017-09-18T16:57:31,811][INFO ][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>[#<URI::HTTP:0x67977d1a URL:http://localhost:9200>]}
[2017-09-18T16:57:31,812][INFO ][logstash.pipeline ] Starting pipeline {"id"=>".monitoring-logstash", "pipeline.workers"=>1, "pipeline.batch.size"=>2, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>2}
[2017-09-18T16:57:31,812][INFO ][logstash.pipeline ] Pipeline .monitoring-logstash started
[2017-09-18T16:57:31,832][INFO ][logstash.inputs.tcp ] Starting tcp input listener {:address=>"0.0.0.0:1514"}
[2017-09-18T16:57:31,841][INFO ][logstash.inputs.udp ] Starting UDP listener {:address=>"0.0.0.0:1514"}
[2017-09-18T16:57:31,850][INFO ][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://elastic:xxxxxx@192.168.1.233:9200/]}}
[2017-09-18T16:57:31,850][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://elastic:xxxxxx@192.168.1.233:9200/, :path=>"/"}
[2017-09-18T16:57:31,859][INFO ][logstash.inputs.udp ] UDP listener started {:address=>"0.0.0.0:1514", :receive_buffer_bytes=>"106496", :queue_size=>"2000"}
[2017-09-18T16:57:31,881][WARN ][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>#<URI::HTTP:0xbf4f38f URL:http://elastic:xxxxxx@192.168.1.233:9200/>}
[2017-09-18T16:57:31,882][INFO ][logstash.outputs.elasticsearch] Using mapping template from {:path=>nil}
[2017-09-18T16:57:31,924][INFO ][logstash.outputs.elasticsearch] Attempting to install template {:manage_template=>{"template"=>"logstash-*", "version"=>50001, "settings"=>{"index.refresh_interval"=>"5s"}, "mappings"=>{"_default_"=>{"_a$
[2017-09-18T16:57:31,927][INFO ][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>[#<URI::Generic:0x49bbcdf1 URL://192.168.1.233:9200>]}
[2017-09-18T16:57:31,995][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2017-09-18T16:58:39,519][INFO ][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://logstash_system:xxxxxx@localhost:9200/_xpack/monitoring/?system_id=logstash&system_api_version=2&$
[2017-09-18T16:58:39,523][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://logstash_system:xxxxxx@localhost:9200/, :path=>"/"}
[2017-09-18T16:58:39,626][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>#<URI::HTTP:0x5309fd29 URL:http://logstash_system:xxxxxx@localhost:9200/_xpack/monitoring/?$
[2017-09-18T16:58:39,628][INFO ][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>[#<URI::HTTP:0x4280dd97 URL:http://localhost:9200>]}
[2017-09-18T16:58:39,629][INFO ][logstash.pipeline ] Starting pipeline {"id"=>".monitoring-logstash", "pipeline.workers"=>1, "pipeline.batch.size"=>2, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>2}
[2017-09-18T16:58:39,629][INFO ][logstash.pipeline ] Pipeline .monitoring-logstash started
[2017-09-18T16:58:39,645][INFO ][logstash.inputs.tcp ] Starting tcp input listener {:address=>"0.0.0.0:1514"}
[2017-09-18T16:58:39,653][INFO ][logstash.inputs.udp ] Starting UDP listener {:address=>"0.0.0.0:1514"}
[2017-09-18T16:58:39,661][INFO ][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://elastic:xxxxxx@192.168.1.233:9200/]}}
[2017-09-18T16:58:39,661][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://elastic:xxxxxx@192.168.1.233:9200/, :path=>"/"}
[2017-09-18T16:58:39,678][INFO ][logstash.inputs.udp ] UDP listener started {:address=>"0.0.0.0:1514", :receive_buffer_bytes=>"106496", :queue_size=>"2000"}
If I could get some help that would be great!