Gagantous
Gagantous

Reputation: 518

How to to retrieve OSSEC's log alerts into Elasticsearch (ELK)?

I have tried this tutorial. But it didn't catch the OSSEC log (alerts, syslog, etc), it just give me this message for my Kibana apps.

Couldn't find any Elasticsearch data You'll need to index some data into Elasticsearch before you can create an index pattern.

I know that there is some tutorial like this. But it's required to use wazuh package and I dont want to use it, I just want to use the pure OSSEC. My OSSEC and ELK apps are located in the samw machine

My question is, How can I integrate OSSEC with ELK ? What configuration do i have to do first before starting connected OSSEC to ELK ?

Upvotes: 11

Views: 2532

Answers (1)

HackSlash
HackSlash

Reputation: 5803

You need to load the data template so that Elastisearch can understand the format of the alert data. You can use the one made by Wazuh, or you could download it and modify it to "make your own". If you go down this road you will eventually end up trying to re-write Wazuh, which you don't need to do because it is open source. You can just download all the source files and do whatever you want with them.

Command to load template:

curl https://raw.githubusercontent.com/wazuh/wazuh/3.2/extensions/elasticsearch/wazuh-elastic6-template-alerts.json | curl -XPUT 'http://localhost:9200/_template/wazuh' -H 'Content-Type: application/json' -d @-

Download Template:

https://raw.githubusercontent.com/wazuh/wazuh/3.2/extensions/elasticsearch/wazuh-elastic6-template-alerts.json

-OR-

You could just spin up a Docker container that is ready to go:

https://github.com/wazuh/docker-ossec-elk

Upvotes: 2

Related Questions