Hi Simon,
so the 1.-st step says "Create a lifecycle policy"
My policy "filebeat-cisco_policy"
PUT _ilm/policy/filebeat-cisco_policy
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"rollover": {
"max_age": "1d",
"max_size": "200gb"
},
"set_priority": {
"priority": 100
}
}
},
"cold": {
"min_age": "7d",
"actions": {
"set_priority": {
"priority": 25
}
}
},
"delete": {
"min_age": "30d",
"actions": {
"delete": {}
}
}
}
}
}
2-nd Create an index template
I am using default Filebeat template with minor changes in "Index patterns" field
{
"index": {
"lifecycle": {
"name": "filebeat-cisco_policy",
"rollover_alias": "filebeat-cisco"
},
"mapping": {
"total_fields": {
"limit": "10000"
}
},
"refresh_interval": "5s",
"number_of_shards": "2",
"query": {
"default_field": [
"message",
"tags",
"agent.ephemeral_id",
"agent.id",
"agent.name",
"agent.type",
"agent.version",
"as.organization.name",
"client.address",
"client.as.organization.name",
"client.domain",
"client.geo.city_name",
"client.geo.continent_name",
"client.geo.country_iso_code",
"client.geo.country_name",
"client.geo.name",
"client.geo.region_iso_code",
"client.geo.region_name",
"client.mac",
"client.registered_domain",
"client.top_level_domain",
"client.user.domain",
"client.user.email",
"client.user.full_name",
"client.user.group.domain",
"client.user.group.id",
"client.user.group.name",
"client.user.hash",
"client.user.id",
"client.user.name",
"cloud.account.id",
"cloud.availability_zone",
"cloud.instance.id",
"cloud.instance.name",
"cloud.machine.type",
"cloud.provider",
"cloud.region",
"container.id",
"container.image.name",
"container.image.tag",
...deleted
"fields.*"
]
}
}
}
3.-rd Bootstrap an index as my case it's done by filebeat
My Filebeat.yml
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["ip:9200"]
username: "elastic"
password: "password"
ssl.certificate_authorities: ["/etc/elasticsearch/certs/ca/ca.crt"]
ssl.certificate: "/etc/elasticsearch/certs/filebeat/filebeat.crt"
ssl.key: "/etc/elasticsearch/certs/filebeat/filebeat.key"
# Protocol - either `http` (default) or `https`.
protocol: "https"
# Authentication credentials - either API key or username/password.
#api_key: "id:api_key"
indices:
- index: "filebeat-netflow-%{+yyyy.MM.dd}-000001"
when.equals:
event.module: "netflow"
- index: "filebeat-cisco-%{+yyyy.MM.dd}-000001"
when.equals:
event.module: "cisco"
I have deleted aliases from the template and I deleted the indices. When I got error again I will add error message.