<a id="elasticsearch"></a>

# Elasticsearch

To enable actions logging there are some steps that need to be completed which are outlined below.

<a id="install-elasticsearch"></a>

## Install Elasticsearch

Elastic has an article on installing Elasticsearch [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html).

<a id="import-an-index-template"></a>

## Import an index template

Import the template and policy below into Elasticsearch.

<a id="action-events"></a>

### Action events

For this template you should set the value for [`elasticsearch.index.actions`](config_startup.html.md#confval-elasticsearch.index.actions) to match.

> ```console
> curl -k -X PUT -H "Content-Type: application/json" -d @/opt/halon/policyd/share/elasticsearch/actions/halon-policyd-actions-timeseries-policy.json http://elastic:elastic@127.0.0.1:9200/_ilm/policy/halon-policyd-actions-timeseries-policy
> curl -k -X PUT -H "Content-Type: application/json" -d @/opt/halon/policyd/share/elasticsearch/actions/halon-policyd-actions.json http://elastic:elastic@127.0.0.1:9200/_index_template/halon-policyd-actions
> ```
