繁体   English   中英

kibana4和suricata json过滤未正确显示

[英]kibana4 and suricata json filtering not showing up correct

我已经运行了ELK堆栈,并在上面也放了一些suricata

我认为我已经正确设置了它,因为它将日志从主机发送到ELK服务器

在kibana中,我可以看到eve.json文件并看到数据,但是由于所有重要信息都存储在message字段中,因此我似乎无法正确格式化它。 我以为我可以像其他领域一样在kibana中过滤掉它?

还是我错过了什么?

{
  "_index": "logstash-2015.04.09",
  "_type": "suricata",
  "_id": "",
  "_score": null,
  "_source": {
    "message": "{\"timestamp\":\"2015-04-09T14:33:43.585096\",\"event_type\":\"alert\",\"src_ip\":\"x.x.x.x\",\"src_port\":40238,\"dest_ip\":\"x.x.x.x\",\"dest_port\":443,\"proto\":\"TCP\",\"alert\":{\"action\":\"allowed\",\"gid\":1,\"signature_id\":2402000,\"rev\":3672,\"signature\":\"ET DROP Dshield Block Listed Source group 1\",\"category\":\"Misc Attack\",\"severity\":2}}",
    "@version": "1",
    "@timestamp": "2015-04-09T13:33:41.389Z",
    "type": "suricata",
    "file": "/var/log/suricata/eve.json",
    "host": "xx",
    "offset": "51171"
  },
  "fields": {
    "@timestamp": [
      1428586421389
    ]
  },
  "highlight": {
    "message": [
      "{\"timestamp\":\"2015-04-09T14:33:43.585096\",\"event_type\":\"@kibana-highlighted-field@alert@/kibana-highlighted-field@\",\"src_ip\":\"x.x.x.x\",\"src_port",
      "\":40238,\"dest_ip\":\"x.x.x.x\",\"dest_port\":443,\"proto\":\"TCP\",\"@kibana-highlighted-field@alert@/kibana-highlighted-field@\":{\"action\":\"allowed\",\"gid\":1"
    ]
  },
  "sort": [
    1428586421389
  ]
}

像这样设置了logstash conf文件

filter {
  if [type] == "SuricataIDPS" {
    date {
      match => [ "timestamp", "ISO8601" ]
    }
    ruby {
      code => "if event['event_type'] == 'fileinfo'; event['fileinfo']['type']=event['fileinfo']['magic'].to_s.split(',')[0]; end;"
    }
  }

  if [src_ip]  {
    geoip {
      source => "src_ip"
      target => "geoip"
      #database => "/opt/logstash/vendor/geoip/GeoLiteCity.dat"
      add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
      add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}"  ]
    }
    mutate {
      convert => [ "[geoip][coordinates]", "float" ]
    }
    if ![geoip.ip] {
      if [dest_ip]  {
        geoip {
          source => "dest_ip"
          target => "geoip"
          #database => "/opt/logstash/vendor/geoip/GeoLiteCity.dat"
          add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
          add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}"  ]
        }
        mutate {
          convert => [ "[geoip][coordinates]", "float" ]
        }
      }
    }
  }
}

我想我通过向伐木工人的主要输入添加codec => json来解决此问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM