Can someone please review this file for errors? I have been over it and over it and I keep getting this error:
[2019-03-01T14:46:07,935][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, => at line 3076, column 20 (byte 99857) after filter {\n if [syslog-host_from] =~ "fireeye-nx" {\n json {\n source => "message"\n \n mutate ",
I have removed every mutate statement down to the last one and I still get the same error. Here is the original file. Does anyone see an issue?
OK, so that definitely fixed the config file. New issue though, the logs are not showing up in Kibana anymore and when they are ingested Logstash is throwing the following alert:
[2019-03-01T18:04:46,124][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"logstash-syslog-2019.03.01", :_type=>"doc", :routing=>nil}, #LogStash::Event:0x64390edd], :response=>{"index"=>{"_index"=>"logstash-syslog-2019.03.01", "_type"=>"doc", "_id"=>"dtBuOmkBH9aLgbCWEjuq", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [alert] of type [text]", "caused_by"=>{"type"=>"illegal_state_exception", "reason"=>"Can't get text on a START_OBJECT at 1:174"}}}}}
My guess is that the "alert" field that it mentions is coming back blank as this is the parent field of many nested fields. See log below:
{
"alert": {
"ack": "no",
"action": "blocked",
"alert-url": "https://hexxxxx-cms-ssh.hex01.helix.apps.xxxxxx.xxx/event_stream/events_for_bot?ev_id=1450064&lms_iden=0025905E4418",
"dst": {
"ip": "x.x.x.x"
},
"explanation": {
"malware-detected": {
"malware": {
"name": "Phish.URL"
}
}
},
"id": "1450064",
"name": "infection-match",
"occurred": "2019-03-01T17:49:09Z",
"severity": "minr",
"src": {
"host": "xxxxxxx",
"ip": "x.x.x.x",
"vlan": "0"
},
"uuid": "95486f3b-f231-4bd1-xxxx-173bxxxxxx19"
},
"appliance": "xxxxxxx",
"appliance-id": "xxxxxxx",
"msg": "concise",
"product": "xxxxxxx",
"version": "xxxxxxxx"
}
So elasticsearch expects alert to be a text field, not a structured object. It has to be one or the other. What does alert look like on the records already in elasticsearch?
It is starting to look more and more like this log source needs a dedicated template. I was trying to avoid that by renaming fields to match the existing template.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.