Use the CIM to normalize CPU performance metrics
This example illustrates how to normalize data for CIM-compliance for an IT Service Intelligence use case. This example provides two variations: one using Splunk Web, and another using configuration files from the command line.
Normalize data for CIM-compliance using Splunk Web
Step 1. Get your data in
For the purposes of this example, assume that you have already added data to your Splunk platform deployment. For instructions on adding data, see Getting Data In.
Step 2. Examine your data in context of the CIM
Make sure that the data that you want to extract has a dataset specified in the CIM. For example, if you want to build a KPI search based on a specific CPU performance metric, such as cpu_load_percent
, review the Performance data model to make sure that the data model lists CPU
as a dataset.
If the CIM does not contain the specific data that you want to extract for your KPI searches, you can use a Splunk add-on or apply the Common Information Model to your own data. See Design data models in the Splunk Enterprise Knowledge Manager Manual.
Step 3. Configure CIM-compliant event types
- From Splunk Web, select Settings > Data Models.
- Find the data model dataset that you want to map your data to, then identify its associated tags. For example, the
CPU
dataset in thePerformance
data model has the following tags associated with it:tag = performance[/topic/topic/body/section/ol/li/codeblock/div {""}) (div]tag = cpu
[/topic/topic/body/section/ol/li
{""}) Create an event type.
[/topic/topic/body/section/ol/li/ol
{""}) [/topic/topic/body/section/ol/li/ol/li
{""}) Select [/topic/topic/body/section/ol/li/ol/li/b
{""}) Settings > Event types (b]. (li][/topic/topic/body/section/ol/li/ol/li
{""}) Click [/topic/topic/body/section/ol/li/ol/li/b
{""}) New. (b] (li][/topic/topic/body/section/ol/li/ol/li
{""}) In the [/topic/topic/body/section/ol/li/ol/li/b
{""}) Add new (b] dialog, type the following values for the following fields.
[/topic/topic/body/section/ol/li/ol/li/table
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/colspec
{""}) (colspec][/topic/topic/body/section/ol/li/ol/li/table/tgroup/colspec
{""}) (colspec][/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry/b
{""}) Destination App: (b] (entry][/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry
{""}) ITSI
(entry] (row][/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry/b
{""}) Name: (b] (entry][/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry
{""}) Type the name of the event type. For example, [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry/codeph
{""}) cpu_metrics (codeph].
(entry] (row][/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry/b
{""}) Search String: (b] (entry][/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry
{""}) Type a search string for the event type. For example, [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry/codeph
{""}) sourcetype=test_cpu_log (codeph].
(entry] (row][/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry/b
{""}) Tag(s): (b] (entry][/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry
{""}) Type the tags associated with the data model dataset you are mapping to. For example, [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry/codeph
{""}) performance (codeph], [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry/codeph
{""}) cpu (codeph].
(entry] (row][/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry/b
{""}) Color (b] (entry][/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry
{""}) Select a color for the event type. Priority determines which event type color displays for an event. For more information, see [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry/xref
{"unresolved-reference"}) ERROR - unresolved reference (SplunkCloud_9.3.2411_Knowledge_Abouteventtypepriorities) (xref].
(entry] (row][/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry
{""}) [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry/b
{""}) Priority (b] (entry][/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry
{""}) Select a priority from 1 to 10, with 1 being the highest and 10 being the lowest. For more information, see [/topic/topic/body/section/ol/li/ol/li/table/tgroup/tbody/row/entry/xref
{"unresolved-reference"}) ERROR - unresolved reference (SplunkCloud_9.3.2411_Knowledge_Abouteventtypepriorities) (xref].
(entry] (row] (tbody] (tgroup] (table]
(li] (ol]
(li]
[/topic/topic/body/section/ol/li
{""}) Click [/topic/topic/body/section/ol/li/b
{""}) Save (b]. (li]
Normalize data for CIM-compliance using configuration files
This section demonstrates how to normalize data for CIM-compliance at search-time using Splunk configuration files.
Step 1. Get your data in
For the purposes of this example, assume that you have already added data to your Splunk platform deployment. For instructions on adding data, see Getting Data In.
Step 2. Examine your data in context of the CIM
Make sure that the data that you want to extract has a dataset specified in the CIM. For example, if you want to build a KPI search based on a specific CPU performance metric, such as cpu_load_percent
, review the Performance data model to make sure that the data model lists CPU
as a dataset.
If the CIM does not contain the specific data that you want to extract for your KPI searches, you can use a Splunk add-on or apply the Common Information Model to your own data. See Design data models in the Splunk Enterprise Knowledge Manager Manual.
Step 3. Configure CIM-compliant event tags
- Determine which tags are associated with the data model dataset. In Splunk Web, select Settings > Data Models.
- Find the data model dataset that you want to map your data to, then identify its associated tags. For example, the
cpu_load_percent
attribute in theCPU
dataset in thePerformance
data model has the following tags associated with it:tag = performance[/topic/topic/body/section/ol/li/codeblock/div {""}) (div]tag = cpu
[/topic/topic/body/section/ol/li
{""}) On the search head, edit or create an [/topic/topic/body/section/ol/li/codeph
{""}) $SPLUNK_HOME/etc/apps/$APPNAME$/local/eventtypes.conf (codeph] file, then manually add the event type. [/topic/topic/body/section/ol/li/div
{""}) (div]For example:
[/topic/topic/body/section/ol/li/codeblock
{""}) [cpu_metrics]
search = sourcetype=test_cpu_log
(codeblock] (li]
[/topic/topic/body/section/ol/li
{""}) On the search head, edit or create a [/topic/topic/body/section/ol/li/codeph
{""}) $SPLUNK_HOME/etc/apps/$APPNAME$/local/tags.conf (codeph] file, then manually add the appropriate tags for the data model dataset. For example:[/topic/topic/body/section/ol/li/div
{""}) (div]
[/topic/topic/body/section/ol/li/codeblock
{""}) [eventtype=cpu_metrics]
performance = enabled
cpu = enabled
(codeblock] (li]
[/topic/topic/body/section/ol/li
{""}) Restart the Splunk platform. (li]