[WARN ] 2019-09-17 20:58:36.973 [[wazuh]>worker11] elasticsearch - Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"wazuh-alerts-3.x-2019.09.17", :_type=>"_doc", :routing=>nil}, #<LogStash::Event:0x3f2141d9>], :response=>{"index"=>{"_index"=>"wazuh-alerts-3.x-2019.09.17", "_type"=>"_doc", "_id"=>"n04FQW0BvOg7U9x3DkMM", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [host] of type [keyword] in document with id 'n04FQW0BvOg7U9x3DkMM'. Preview of field's value: '{name=CLUSTER_NAME}'", "caused_by"=>{"type"=>"illegal_state_exception", "reason"=>"Can't get text on a START_OBJECT at 1:1190"}}}}}
- type: log
enabled: true
paths:
- "/var/ossec/logs/alerts/alerts.json"
fields_under_root: true
document_type: json
json.message_key: log
json.keys_under_root: true
json.overwrite_keys: true
fields:
beat.type: wazuh_alertsinput {
redis {
data_type => "channel"
key => "wazuh"
}
}
output {
elasticsearch {
hosts => [ "IP1:9200", "IP2:9200", "IP3:9200", "IP4:9200" ]
index => "wazuh-alerts-3.x-%{+YYYY.MM.dd}"
}
}
wazuh-custom [wazuh-alerts-3.x-*, wazuh-archives-3.x-*] 0 1
.monitoring-es [.monitoring-es-7-*] 0 7000199
.ml-anomalies- [.ml-anomalies-*] 0 7030299
.monitoring-beats [.monitoring-beats-7-*] 0 7000199
.watches [.watches*] 2147483647
.monitoring-alerts [.monitoring-alerts-6] 0 6050399
.watch-history-10 [.watcher-history-10*] 2147483647
.watch-history-7 [.watcher-history-7*] 2147483647
.ml-state [.ml-state*] 0 7030299
security-index-template [.security-*] 1000
.triggered_watches [.triggered_watches*] 2147483647
instartlogic [instartlogic-*] 0
.watch-history-9 [.watcher-history-9*] 2147483647
.management-beats [.management-beats] 0 70000
wazuh-agent [wazuh-monitoring-3.x-*] 0
.ml-config [.ml-config] 0 7030299
o365uls [o365uls-*] 0
.ml-meta [.ml-meta] 0 7030299
.data-frame-internal-1 [.data-frame-internal-1] 0 7030299
fortigate [fortigate-*] 0
.monitoring-kibana [.monitoring-kibana-7-*] 0 7000199
cbdefense [cbdefense-*] 0
.ml-notifications [.ml-notifications] 0 7030299
.monitoring-alerts-7 [.monitoring-alerts-7] 0 7000199
.logstash-management [.logstash] 0
metricbeat-6.5.0 [metricbeat-6.5.0-*] 1
meraki [meraki-*] 0
.monitoring-logstash [.monitoring-logstash-7-*] 0 7000199
logstash [logstash-*] 0 60001
.kibana_task_manager [.kibana_task_manager] 0 7030299
defaults-beats [beats-*] 0
defaults-syslog [syslog-*] 0
o365api [o365api-*] 0
.data-frame-notifications-1 [.data-frame-notifications-*] 0 7030299Hi Derek, sorry for the late response.
Since ELK 7.x, Filebeat can ingest data directly into Elasticsearch. In this version, Logstash is no longer required because that way the architecture is more simple and consumes fewer resources, so I recommend configuring Filebeat with Elasticsearch.
You can find the configuration files in our documentation:
https://documentation.wazuh.com/3.10/installation-guide/installing-wazuh-manager/index.html
But if you prefer it we can help you configure your system to work with Logstash. Could you please share your OS and software versions?
Elastic version:
curl ELASTIC_IP:9200?pretty
Kibana version:
/usr/share/kibana/bin/kibana --version
Filebeat version:
/usr/share/filebeat/bin/filebeat version
Logstash version:
/usr/share/logstash/bin/logstash --version
Wazuh version:
cat /var/ossec/etc/ossec-init.conf
Wazuh API version:
cat /var/ossec/api/package.json
Wazuh APP version:
cat /usr/share/kibana/plugins/wazuh/package.json
Regards,
Javier
Elastic version:
curl ELASTIC_IP:9200?pretty
Kibana version:
/usr/share/kibana/bin/kibana --version
Filebeat version:
/usr/share/filebeat/bin/filebeat version
Logstash version:
/usr/share/logstash/bin/logstash --version
Wazuh version:
cat /var/ossec/etc/ossec-init.conf
Wazuh API version:
cat /var/ossec/api/package.json
Wazuh APP version:
cat /usr/share/kibana/plugins/wazuh/package.json
Hi again Derek,
Following these steps you can configure Filebeat to the latest version:-Download the Filebeat configuration file:
curl -so /etc/filebeat/filebeat.yml https://raw.githubusercontent.com/wazuh/wazuh/v3.10.0/extensions/filebeat/7.x/filebeat.yml
chmod go+r /etc/filebeat/filebeat.yml
-Download the Wazuh module for Filebeat:
curl -s https://packages.wazuh.com/3.x/filebeat/wazuh-filebeat-0.1.tar.gz | sudo tar -xvz -C /usr/share/filebeat/module
-Edit the file /etc/filebeat/filebeat.yml and replace the output with the IP addresses of Elasticsearch.For more information:
https://documentation.wazuh.com/3.10/installation-guide/installing-wazuh-manager/linux/centos/wazuh_server_packages_centos.html#installing-filebeatLet me know if you have any issues with the configuration.Regards,
Javier Escobar
Hi Derek,
It seems like an issue related to the upgrade of Elasticsearch. In the upgrade from 6.8 to 7.x there was a field migration from @timestamp to timestamp. Due to this change, previous alerts won’t be visible in Wazuh indices, an update must be performed to all previous indices in order to complete the upgrade.
You can see the index pattern fields at Kibana -> Management -> Index Patterns and click on wazuh-alerts-3.x-*. It should look like this:

Run below request for each Wazuh index that was created before Elastic 7.x upgrade. It will add the timestamp field for all the index documents:
curl -X POST "localhost:9200/wazuh-alerts-3.x-2019.05.16/wazuh/_update_by_query?wait_for_completion=true" -H 'Content-Type: application/json' -d'
{
"query": {
"bool": {
"must_not": {
"exists": {
"field": "timestamp"
}
}
}
},
"script": "ctx._source.timestamp = ctx._source[\"@timestamp\"]"
}
'
For more information, we have a documentation page related to the issue:
To be safe please share the wazuh template that you are using.
I hope it helps.
Regards,
Javier Escobar