Hi
I am running a logstash program to read the log file into the elastic db. Below is the sample file:
[2018-05-29 08:04:23,687] DEBUG - http-outgoing-2845 HTTP/1.1 500 Internal Server Error {org.apache.synapse.transport.http.headers}
[2018-05-29 08:04:11,797] DEBUG - >> "OPTIONS /intrCaco2.1.1/2.1.1/api/service/predict HTTP/1.1[\r][\n]" {org.apache.synapse.transport.http.wire}
[2018-05-29 08:04:12,109] DEBUG - http-outgoing-2842 >> POST /intrcaco2_2.1.1/api/service/predict HTTP/1.1 {org.apache.synapse.transport.http.headers}
[2018-05-29 08:04:18,037] DEBUG - http-outgoing-2842 << HTTP/1.1 200 OK {org.apache.synapse.transport.http.headers}
[2018-05-29 08:04:23,687] DEBUG - http-outgoing-2845 << HTTP/1.1 500 Internal Server Error {org.apache.synapse.transport.http.headers}
Code:
input {
file{
path => "/home/abhi/filesmall.log"
}
}
filter {
grok {
match => {
'message' => '%{SYSLOG5424SD:date1} %{WORD:level} - %{GREEDYDATA:extra1}'
}
}
}
output{
elasticsearch
{
hosts => [ "SCPUBU:9200" ]
}
}
Instead of elasticsearch in output plugin if i use stdout i get the ouput. If i use elasticsearch there is no result and below is the log:
[2018-06-19T18:19:55,111][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.2.4"}
[2018-06-19T18:19:55,206][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2018-06-19T18:19:55,442][INFO ][logstash.pipeline ] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50}
[2018-06-19T18:19:55,586][INFO ][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://SCPUBU:9200/]}}
[2018-06-19T18:19:55,588][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://SCPUBU:9200/, :path=>"/"}
[2018-06-19T18:19:55,643][WARN ][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>"http://SCPUBU:9200/"}
[2018-06-19T18:19:55,667][INFO ][logstash.outputs.elasticsearch] ES Output version determined {:es_version=>6}
[2018-06-19T18:19:55,667][WARN ][logstash.outputs.elasticsearch] Detected a 6.x and above cluster: the type
event field won't be used to determine the document _type {:es_version=>6}
[2018-06-19T18:19:55,669][INFO ][logstash.outputs.elasticsearch] Using mapping template from {:path=>nil}
[2018-06-19T18:19:55,672][INFO ][logstash.outputs.elasticsearch] Attempting to install template {:manage_template=>{"template"=>"logstash-", "version"=>60001, "settings"=>{"index.refresh_interval"=>"5s"}, "mappings"=>{"default"=>{"dynamic_templates"=>[{"message_field"=>{"path_match"=>"message", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false}}}, {"string_fields"=>{"match"=>"", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false, "fields"=>{"keyword"=>{"type"=>"keyword", "ignore_above"=>256}}}}}], "properties"=>{"@timestamp"=>{"type"=>"date"}, "@version"=>{"type"=>"keyword"}, "geoip"=>{"dynamic"=>true, "properties"=>{"ip"=>{"type"=>"ip"}, "location"=>{"type"=>"geo_point"}, "latitude"=>{"type"=>"half_float"}, "longitude"=>{"type"=>"half_float"}}}}}}}}
[2018-06-19T18:19:55,677][INFO ][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["//SCPUBU:9200"]}
[2018-06-19T18:19:55,832][INFO ][logstash.pipeline ] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x5dc58d8c@/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:247 sleep>"}
[2018-06-19T18:19:55,842][INFO ][logstash.agent ] Pipelines running {:count=>1, :pipelines=>["main"]}
^C[2018-06-19T18:20:13,761][WARN ][logstash.runner ] SIGINT received. Shutting down.
[2018-06-19T18:20:14,682][INFO ][logstash.pipeline ] Pipeline has terminated {:pipeline_id=>"main", :thread=>"#<Thread:0x5dc58d8c@/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:247 run>"}
can someone help me?