Thanks for your replies @clearedskies!
With regards to your questions:
However, I have structured my output so Logstash outputs the logs to a new index each day, in the format of '''logstash-logs-%{+YYYY.MM.dd}''' .
This raises a problem of configuring the mappings. I would rather not have to manually, everyday, adjust the mappings of each index. Is there any solution that you know of?
Am I right in thinking that I would have to use index templates so these category fields are implemented and if so is it possible to use the Kibana interface to set these up and any idea on the notation needed?
and
Yes, it's possible to use Kibana (or the index template API) to define the mappings once, so they are automatically applied to every new index created that matches a pattern, like logstash-logs-%{+YYYY.MM.dd}
in your example.
Let's adapt our previous example to your use case. We will build an index template in Kibana, and get the custom categories in the template to appear in the Customize Columns
view in the SIEM app:
Resetting the siem:defaultIndex
setting
First, in Kibana Advanced Settings, let's reset the siem:defaultIndex
to the default value by clicking the Reset to default
button:
After restoring the default, I reloaded the SIEM app and verified the custom categories from our previous example no longer appear:
In the next section, we'll create an Index Template using Kibana.
Creating an Index Template
On the Index Templates
tab of the Kibana Index Management page, click the Create a template
button shown in the screenshot below:
In Step 1 (as shown in the screenshot below), enter logstash-logs-*
in the Index patterns section so it matches the logstash-logs-%{+YYYY.MM.dd}
indexes in your use case:
After entering the index pattern in the screenshot above, click Next >
twice to advance to Step 3, Mappings, shown in the screenshot below:
Let's create the following (example) mappings:
"mappings" : {
"properties" : {
"field1" : { "type" : "text" },
"category1.fieldA" : { "type" : "text" },
"category1.fieldB" : { "type" : "text" },
"category2.fieldA" : { "type" : "text" }
}
}
Per the screenshot below, enter the mappings for our template:
After specifying the mappings in the screenshot above, click Next >
twice to advance to Step 5, Review template, shown in the screenshot below:
Click the Create template
button shown in the screenshot above to create the template.
We just created a new index template. In the next section, we'll verify the template is correctly applied to newly created indexes.
Verify the Index Template
To verify the index template is correctly applied to newly-created indexes (note: it will not retroactively be applied to existing indexes) , I created a new index via Kibana Dev Tools to match the logstash-logs-%{+YYYY.MM.dd}
format in your example:
PUT /logstash-logs-2020.05.28
After creating the above index, I filtered the Indices tab on the Index Management page to find the newly created index, as shown in the screenshot below:
As shown in the screenshot below, clicking on the newly-created index and selecting the Mappings tab reveals that our template was correctly applied to the index:
Now that we verified our index pattern is correctly being applied to newly-created indexes, we're ready to add the logstash-logs-*
index pattern to the SIEM app in the next section.
Adding logstash-logs-*
to the siem:defaultIndex
setting
Let's add our logstash-logs-*
index pattern to the SIEM app.
In Kibana Advanced settings, add , logstash-logs-*
to the siem:defaultIndex
setting:
apm-*-transaction*, auditbeat-*, endgame-*, filebeat-*, packetbeat-*, winlogbeat-*, logstash-logs-*
as shown in the screenshot below:
NOTE: Be sure to click the Save changes
button after editing the above
We're now ready to view our custom categories in the SIEM app (in the next section).
Viewing the custom categories in the Customize Columns
view
After saving the changes in the previous section and reloading the SIEM app, we can now see our custom categories and fields in the Customize Columns
view, as shown in the screenshot below:
Consider using Beats
The steps above accomplish our goal of getting custom categories and fields to appear in the Customize Columns
view, which is (IMO) an advanced use case. That said, I think it's worth noting that the SIEM app was built from the ground up to use the Elastic Common Schema.
To unlock the full potential of the SIEM app, consider using the Beats specified in the siem:defaultIndex
setting, i.e. Auditbeat, Filebeat, Packetbeat, Winlogbeat.
These Beats all conform to the Elastic Common Schema, so ingesting data with them will, for example, enable SIEM features like the Timeline to render events as shown in the screenshot below:
Getting started with Auditbeat
Consider getting started by ingesting some data with Auditbeat by clicking the Add data
button in the screenshot below, and then choosing Auditbeat:
From there, Kibana will guide you through the process of downloading Auditbeat, configuring it, and ingesting data.