<decoder name="web-accesslog-iis-default">
<type>web-log</type>
<use_own_name>true</use_own_name>
<prematch>^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d \S* GET |^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d \S* POST </prematch>
<regex>^(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d) \S* \S* (\S+ \S*) (\d*) (\S*) (\S*) (\S*) (\S*) (\d*) (\d*) (\d*) (\d*)</regex>
<order>date_utc,url,srcport,username,srcip,ua,referer,id,subcode,win32status,timetaken</order>
</decoder>"timetaken: {
"type: "long",
"doc_values": "true"
},PUT /_template/wazuh/_mapping/_doc
{
"properties": {
"timetaken": {
"type": "long"
}
}
}
{
"error": "no handler found for uri [/_template/wazuh/_mapping/_doc?pretty] and method [PUT]"
}PUT /_template/wazuh
{
"mappings":{
"properties": {
"timetaken": {
"type": "long"
}
}
}
}{
"error": {
"root_cause": [
{
"type": "action_request_validation_exception",
"reason": "Validation Failed: 1: index patterns are missing;"
}
],
"type": "action_request_validation_exception",
"reason": "Validation Failed: 1: index patterns are missing;"
},
"status": 400
}
curl https://raw.githubusercontent.com/wazuh/wazuh/3.9/extensions/elasticsearch/wazuh-elastic6-template-alerts.json -o template.json
"data": {
"properties": {
"protocol": {
"type": "keyword",
"doc_values": "true"
},
"timetaken": {
"type": "long",
"doc_values": "true"
},
...
}
curl -X PUT "ip_elasticsearch:9200/_template/wazuh" -H 'Content-Type: application/json' -d @template-alerts.json
{"acknowledged":true}
curl -X POST "ip_elasticsearch:9200/_reindex" -H 'Content-Type: application/json' -d'
{
"source": {
"index": "wazuh-alerts-3.x-2019.05.21"
},
"dest": {
"index": "wazuh-alerts-3.x-backup"
}
}curl -XDELETE "ip_elasticsearch:9200/wazuh-alerts-3.x-2019.01.29"
curl -X POST "ip_elasticsearch:9200/_reindex" -H 'Content-Type: application/json' -d'
{
"source": {
"index": "wazuh-alerts-3.x-backup"
},
"dest": {
"index": "wazuh-alerts-3.x-2019.05.21"
}
}curl -XDELETE ip_elasticsearch:9200/wazuh-alerts-3.x-backup
systemctl restart logstash
systemctl restart kibana
Thanks Adrian,