<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Splunk &#8211; XtremeOwnage</title>
	<atom:link href="https://xtremeownage.com/category/technology/splunk/feed/" rel="self" type="application/rss+xml" />
	<link>https://xtremeownage.com</link>
	<description>Cars, Computers, and Code.</description>
	<lastBuildDate>Tue, 21 Mar 2023 19:02:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>

<image>
	<url>https://xtremeownage.com/wp-content/uploads/2019/09/cropped-Turbo-512-2-100x100.png</url>
	<title>Splunk &#8211; XtremeOwnage</title>
	<link>https://xtremeownage.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Splunk &#8211; Adding TrendLine for Percent Change</title>
		<link>https://xtremeownage.com/2020/03/11/splunk-adding-trendline-for-percent-change/</link>
		
		<dc:creator><![CDATA[XO]]></dc:creator>
		<pubDate>Wed, 11 Mar 2020 17:21:20 +0000</pubDate>
				<category><![CDATA[Splunk]]></category>
		<guid isPermaLink="false">https://xtremeownage.com/?p=934</guid>

					<description><![CDATA[So- Just a quick example on how to execute a trendline for the percentage change on a chart. This can be useful for predicting future change, and allows you to...]]></description>
										<content:encoded><![CDATA[
<p>So- Just a quick example on how to execute a trendline for the percentage change on a chart.</p>



<p>This can be useful for predicting future change, and allows you to more easily at a glance determine the current trend of your data, when it may not be clear.</p>



<p>Lets start with some base data.</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1901" height="497" src="https://i0.wp.com/xtremeownage.com/wp-content/uploads/2020/03/1_Base-Data.png?fit=1024%2C268&amp;ssl=1" alt="" class="wp-image-935" srcset="https://xtremeownage.com/wp-content/uploads/2020/03/1_Base-Data.png 1901w, https://xtremeownage.com/wp-content/uploads/2020/03/1_Base-Data-300x78.png 300w, https://xtremeownage.com/wp-content/uploads/2020/03/1_Base-Data-1024x268.png 1024w, https://xtremeownage.com/wp-content/uploads/2020/03/1_Base-Data-768x201.png 768w, https://xtremeownage.com/wp-content/uploads/2020/03/1_Base-Data-1536x402.png 1536w" sizes="(max-width: 1901px) 100vw, 1901px" /></figure>



<p>In the above data, the goal is to display the percentage change week to week, as a easy-to-view trendline.</p>



<p>First- we need to calculate the percent change from one interval to the next. Thankfully- this is pretty easy with streamstats.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| streamstats current=f window=1 values(Value) as PValue
| eval PctChange = ((Value-PValue)/PValue)*100
| fields - PValue</pre>



<p>For an explanation- &#8220;streamstats current=f window=1 values(Value) as PValue&#8221; will store the previous value as new variable, &#8220;PValue&#8221;.</p>



<p>We can then use the new variable to calculate the percentage change. This leaves us with the following data.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="964" height="418" src="https://xtremeownage.com/wp-content/uploads/2020/03/2_PctChange.png" alt="" class="wp-image-936" srcset="https://xtremeownage.com/wp-content/uploads/2020/03/2_PctChange.png 964w, https://xtremeownage.com/wp-content/uploads/2020/03/2_PctChange-300x130.png 300w, https://xtremeownage.com/wp-content/uploads/2020/03/2_PctChange-768x333.png 768w" sizes="(max-width: 964px) 100vw, 964px" /></figure>



<p>While, at this point, we could now enable an overlay for PctChange- it does not clearly display our trend. The goal, is for whoever looks at this chart, to be able to clearly see how the data is trending over time.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1900" height="663" src="https://i0.wp.com/xtremeownage.com/wp-content/uploads/2020/03/3_Overlay.png?fit=1024%2C357&amp;ssl=1" alt="" class="wp-image-937" srcset="https://xtremeownage.com/wp-content/uploads/2020/03/3_Overlay.png 1900w, https://xtremeownage.com/wp-content/uploads/2020/03/3_Overlay-300x105.png 300w, https://xtremeownage.com/wp-content/uploads/2020/03/3_Overlay-1024x357.png 1024w, https://xtremeownage.com/wp-content/uploads/2020/03/3_Overlay-768x268.png 768w, https://xtremeownage.com/wp-content/uploads/2020/03/3_Overlay-1536x536.png 1536w" sizes="(max-width: 1900px) 100vw, 1900px" /></figure>



<p>To better accomplish the goal, we are going to utilize the trendline command.</p>



<p>The documentation for Trendline can be found here: <a href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Trendline">Trendline</a></p>



<p>For this example, we are going to do a simple moving average, for at least 4 periods.</p>



<p>| trendline sma4(PctChange) as PctChangeTrend</p>



<p>This should be adequate for smoothing out the results.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1894" height="274" src="https://i2.wp.com/xtremeownage.com/wp-content/uploads/2020/03/4_SmoothedData.png?fit=1024%2C148&amp;ssl=1" alt="" class="wp-image-938" srcset="https://xtremeownage.com/wp-content/uploads/2020/03/4_SmoothedData.png 1894w, https://xtremeownage.com/wp-content/uploads/2020/03/4_SmoothedData-300x43.png 300w, https://xtremeownage.com/wp-content/uploads/2020/03/4_SmoothedData-1024x148.png 1024w, https://xtremeownage.com/wp-content/uploads/2020/03/4_SmoothedData-768x111.png 768w, https://xtremeownage.com/wp-content/uploads/2020/03/4_SmoothedData-1536x222.png 1536w" sizes="(max-width: 1894px) 100vw, 1894px" /><figcaption>Smoothed Change Percentage</figcaption></figure>



<p>Lastly- I do recommend setting the intervals for your overlay to produce an easily distinguishable trend.</p>



<p></p>



<p>Here is my final query:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| inputlookup temp_1.csv
| timechart span=1w sum(value) as Value
| streamstats current=f window=1 values(Value) as PValue
| eval PctChange = ((Value-PValue)/PValue)*100
| trendline sma4(PctChange) as PctChangeTrend
| fields - PValue PctChange</pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1894" height="331" src="https://i0.wp.com/xtremeownage.com/wp-content/uploads/2020/03/5_Final-1.png?fit=1024%2C179&amp;ssl=1" alt="" class="wp-image-941" srcset="https://xtremeownage.com/wp-content/uploads/2020/03/5_Final-1.png 1894w, https://xtremeownage.com/wp-content/uploads/2020/03/5_Final-1-300x52.png 300w, https://xtremeownage.com/wp-content/uploads/2020/03/5_Final-1-1024x179.png 1024w, https://xtremeownage.com/wp-content/uploads/2020/03/5_Final-1-768x134.png 768w, https://xtremeownage.com/wp-content/uploads/2020/03/5_Final-1-1536x268.png 1536w" sizes="(max-width: 1894px) 100vw, 1894px" /><figcaption>My final result.</figcaption></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Splunk – 8.0.1 Metrics vs Events Licensing Comparison &#8211; Updated with Metrics MK</title>
		<link>https://xtremeownage.com/2020/02/11/splunk-8-0-1-metrics-vs-events-licensing-comparison-updated-with-metrics-mk/</link>
		
		<dc:creator><![CDATA[XO]]></dc:creator>
		<pubDate>Tue, 11 Feb 2020 17:01:36 +0000</pubDate>
				<category><![CDATA[Splunk]]></category>
		<category><![CDATA[Metrics]]></category>
		<category><![CDATA[splunk]]></category>
		<guid isPermaLink="false">https://xtremeownage.com/?p=881</guid>

					<description><![CDATA[Splunk 8.0.1 - Perfmon Metrics vs Events License/Disk Comparison. - Updated]]></description>
										<content:encoded><![CDATA[
<p><strong>Note- this page is hidden from view due to inaccuracies discovered long after this article was published. The below method is flawed, and actually only records the first instance from each perfmon category collected.</strong></p>



<p>This is an updated version of the original 8.0.1 test, <a href="https://xtremeownage.com/2020/01/splunk-8-metrics-vs-events/">located here</a>. The reason for the update- Splunk reached out to me and provided me with a newly introduced method of ingesting metrics, as of version 8.0.</p>



<p>As a result, I implemented the new methods, and re-executed the tests, INCLUDING the original methods, along with the new methods as well.</p>


<div class="su-spoiler su-spoiler-style-default su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>TL;DR Spoiler</div><div class="su-spoiler-content su-u-clearfix su-u-trim">



<p>By leveraging the Metrics MK format- I was able to reduce my license requirement by over 90% compared to PerfmonMK format as events. Compared to the default out of the box Perfmon data, over 98% reduction in licensing!</p>



<p>At the same time, It used less overall disk storage then any of the other current methods, while performing MUCH faster!</p>



<p>If you aren&#8217;t evaluating converting your perfmon data to metrics, You need to start!!</p>


</div></div>



<h2 class="wp-block-heading">How testing will be performed</h2>



<p>For testing purposes, I will have four inputs, each pointing at their own separate index. Each of the inputs are configured with the same data collection, and interval.</p>



<ol><li>Regular Perfmon as Events (Default for TA_Windows)</li><li>Regular Perfmon as Metrics</li><li>Perfmon MK as Events</li><li>Perfmon MK as Metrics MK (New Method)</li></ol>



<p>For testing, I will be looking at the LogicalDisk perfmon, collecting data at a 15 second interval, with a very generous handful of metrics selected, to facilitate collecting a lot of data, rather quickly.</p>


<div class="su-accordion su-u-trim">
<div class="su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>inputs.conf</div><div class="su-spoiler-content su-u-clearfix su-u-trim">



<pre class="EnlighterJSRAW" data-enlighter-language="ini" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Regular Perfmon Data, stored in Events index.
[perfmon://LogicalDisk_Event]
counters = % Free Space; Free Megabytes; Current Disk Queue Length; % Disk Time; Avg. Disk Queue Length; % Disk Read Time; Avg. Disk Read Queue Length; % Disk Write Time; Avg. Disk Write Queue Length; Avg. Disk sec/Transfer; Avg. Disk sec/Read; Avg. Disk sec/Write; Disk Transfers/sec; Disk Reads/sec; Disk Writes/sec; Disk Bytes/sec; Disk Read Bytes/sec; Disk Write Bytes/sec; Avg. Disk Bytes/Transfer; Avg. Disk Bytes/Read; Avg. Disk Bytes/Write; % Idle Time; Split IO/Sec
object = LogicalDisk
instances = *
disabled = 1
interval = 15
useEnglishOnly = true
index=perfmon_disk_events
showZeroValue=1

# Regular Perfmon Data, stored in Metrics index.
[perfmon://LogicalDisk_Metric]
counters = % Free Space; Free Megabytes; Current Disk Queue Length; % Disk Time; Avg. Disk Queue Length; % Disk Read Time; Avg. Disk Read Queue Length; % Disk Write Time; Avg. Disk Write Queue Length; Avg. Disk sec/Transfer; Avg. Disk sec/Read; Avg. Disk sec/Write; Disk Transfers/sec; Disk Reads/sec; Disk Writes/sec; Disk Bytes/sec; Disk Read Bytes/sec; Disk Write Bytes/sec; Avg. Disk Bytes/Transfer; Avg. Disk Bytes/Read; Avg. Disk Bytes/Write; % Idle Time; Split IO/Sec
object = LogicalDisk
instances = *
disabled = 1
interval = 15
useEnglishOnly = true
index=perfmon_disk_metrics
showZeroValue=1
sourcetype=Perfmon_To_Metric

# Perfmon MK Data, Stored in Events index.
[perfmon://LogicalDisk_MK_Event]
counters = % Free Space; Free Megabytes; Current Disk Queue Length; % Disk Time; Avg. Disk Queue Length; % Disk Read Time; Avg. Disk Read Queue Length; % Disk Write Time; Avg. Disk Write Queue Length; Avg. Disk sec/Transfer; Avg. Disk sec/Read; Avg. Disk sec/Write; Disk Transfers/sec; Disk Reads/sec; Disk Writes/sec; Disk Bytes/sec; Disk Read Bytes/sec; Disk Write Bytes/sec; Avg. Disk Bytes/Transfer; Avg. Disk Bytes/Read; Avg. Disk Bytes/Write; % Idle Time; Split IO/Sec
object = LogicalDisk
instances = *
disabled = 1
interval = 15
useEnglishOnly = true
index=perfmon_mk_disk_events
mode=multikv
showZeroValue=1

# Perfmon MK Data, Stored in Metrics Index.
[perfmon://LogicalDisk_MK_MVMetric]
counters = % Free Space;; Free Megabytes; Current Disk Queue Length; % Disk Time; Avg. Disk Queue Length; % Disk Read Time; Avg. Disk Read Queue Length; % Disk Write Time; Avg. Disk Write Queue Length; Avg. Disk sec/Transfer; Avg. Disk sec/Read; Avg. Disk sec/Write; Disk Transfers/sec; Disk Reads/sec; Disk Writes/sec; Disk Bytes/sec; Disk Read Bytes/sec; Disk Write Bytes/sec; Avg. Disk Bytes/Transfer; Avg. Disk Bytes/Read; Avg. Disk Bytes/Write; % Idle Time; Split IO/Sec
object = LogicalDisk
instances = *
disabled = 1
interval = 15
mode=multikv
useEnglishOnly = true
index=perfmon_mk_disk_metrics_mk
showZeroValue=1
sourcetype=PerfmonMK_To_MetricMK_AUTO</pre>


</div></div>
<div class="su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>props.conf</div><div class="su-spoiler-content su-u-clearfix su-u-trim">



<pre class="EnlighterJSRAW" data-enlighter-language="ini" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#Convert Regular Perfmon Event, into a Metric
[Perfmon_To_Metric]
TRANSFORMS-_value = value
TRANSFORMS-metric_name = perfmon_metric_name
TRANSFORMS-instance = instance
SEDCMD-remove-whitespace = s/ /_/g s/\s/ /g

#Convert Perfmon MK Event, into a multi-key Metric
[PerfmonMK_To_MetricMK_AUTO]
INDEXED_EXTRACTIONS = tsv
LINE_BREAKER = ([\r\n]+)
NO_BINARY_CHECK = 1
category = Log To Metrics
pulldown_type  = 1
METRIC-SCHEMA-TRANSFORMS = metric-schema:PerfmonMK_To_MetricMK_AUTO
TRANSFORMS-perfmonmk = perfmonmk:PerfmonMK_To_MetricMK_AUTO</pre>


</div></div>
<div class="su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>transforms.conf</div><div class="su-spoiler-content su-u-clearfix su-u-trim">



<pre class="EnlighterJSRAW" data-enlighter-language="ini" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">[value]
REGEX = .*Value=(\S+).*
FORMAT = _value::$1
WRITE_META = true

[perfmon_metric_name]
REGEX = .*object=(\S+).*counter=(\S+).*
FORMAT = metric_name::$1.$2 metric_type::$1
WRITE_META = true

[instance]
REGEX = .*instance=(\S+).*
FORMAT = instance::$1
WRITE_META = true

[metric-schema:PerfmonMK_To_MetricMK_AUTO]
METRIC-SCHEMA-MEASURES = _ALLNUMS_

[perfmonmk:PerfmonMK_To_MetricMK_AUTO]
WRITE_META = 1
REGEX = collection=\"?(?&lt;collection>[^\"\n]+)\"?\ncategory=\"?(?&lt;category>[^\"\n]+)\"?\nobject=\"?(?&lt;object>[^\"\n]+)\"?\n([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t\n([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t\n
FORMAT = collection::"$1" category::"$2" object::"$3" "$4"::"$28" "$5"::"$29" "$6"::"$30" "$7"::"$31" "$8"::"$32" "$9"::"$33" "$10"::"$34" "$11"::"$35" "$12"::"$36" "$13"::"$37" "$14"::"$38" "$15"::"$39" "$16"::"$40" "$17"::"$41" "$18"::"$42" "$19"::"$43" "$20"::"$44" "$21"::"$45" "$22"::"$46" "$23"::"$47" "$24"::"$48" "$25"::"$49" "$26"::"$50" "$27"::"$51"
WRITE_META = true</pre>


</div></div>
<div class="su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>indexes.conf</div><div class="su-spoiler-content su-u-clearfix su-u-trim">



<pre class="EnlighterJSRAW" data-enlighter-language="ini" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Regular Perfmon Data, Events Index.
[perfmon_disk_events]
coldPath = $SPLUNK_DB\$_index_name\colddb
enableDataIntegrityControl = 0
enableTsidxReduction = 0
homePath = $SPLUNK_DB\$_index_name\db
maxTotalDataSizeMB = 512000
thawedPath = $SPLUNK_DB\$_index_name\thaweddb

# Regular Perfmon Data, Metrics Index.
[perfmon_disk_metrics]
coldPath = $SPLUNK_DB\$_index_name\colddb
datatype = metric
enableDataIntegrityControl = 0
enableTsidxReduction = 0
homePath = $SPLUNK_DB\$_index_name\db
maxTotalDataSizeMB = 512000
thawedPath = $SPLUNK_DB\$_index_name\thaweddb

# Perfmon MK Data, Events Index.
[perfmon_mk_disk_events]
coldPath = $SPLUNK_DB\$_index_name\colddb
enableDataIntegrityControl = 0
enableTsidxReduction = 0
homePath = $SPLUNK_DB\$_index_name\db
maxTotalDataSizeMB = 512000
thawedPath = $SPLUNK_DB\$_index_name\thaweddb

# Perfmon MK Data, Metrics Index.
[perfmon_mk_disk_metrics_mk]
coldPath = $SPLUNK_DB\$_index_name\colddb
enableDataIntegrityControl = 0
datatype = metric
enableTsidxReduction = 0
homePath = $SPLUNK_DB\$_index_name\db
maxTotalDataSizeMB = 512000
thawedPath = $SPLUNK_DB\$_index_name\thaweddb</pre>


</div></div>
</div>



<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Testing will be performed on a new install of Splunk enterprise 8.0.1, on my workstation. 32GB ram, xeon processor. (Don&#8217;t worry- I am still trying to get ahold of a Ryzen&#8230;.)</p>



<p>NO additional or 3rd party apps are installed. Testing was performed on a fresh install of Splunk, with only the above configuration files added.</p>



<p>The tests were started at 8:57am, and ended at 9:27am.</p>



<h2 class="wp-block-heading">Data Collection Methods</h2>



<h4 class="wp-block-heading">Event Count</h4>



<p>Count of events was obtained by recording the number displayed at  <a href="http://localhost:8000/en-US/manager/search/data/indexes">http://localhost:8000/en-US/manager/search/data/indexes</a> </p>



<h4 class="wp-block-heading">Storage Usage</h4>



<p>Storage utilization was obtained in Windows explorer by manually going to C:\Program Files\Splunk\var\lib\splunk, right clicking the folders for each of the indexes, and recording &#8220;Size on disk&#8221;</p>



<h4 class="wp-block-heading">License Utilization</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">index=_internal source="C:\\Program Files\\Splunk\\var\\log\\splunk\\license_usage.log"
| stats sum(b) as Size by idx
| eval Size= Size/1024</pre>



<h4 class="wp-block-heading">Performance Testing</h4>



<p>Performance tests will be done with a specific query used for each index. Due to the limited amount of data (30 minutes, at a 15 second interval), there may not be enough data to do a &#8220;Production&#8221; test. Tests will be ran on the same timespan from 9am to 9:30am. An average of 5 query times will be recorded.</p>



<p>Here are the individual searches:</p>


<div class="su-accordion su-u-trim">
<div class="su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>perfmon_disk_events</div><div class="su-spoiler-content su-u-clearfix su-u-trim">
index=perfmon_disk_events instance=&#8221;C:&#8221; counter=&#8221;% Disk Read Time&#8221;<br />
| timechart span=15s avg(Value)<br />
</div></div>
<div class="su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>perfmon_mk_disk_events</div><div class="su-spoiler-content su-u-clearfix su-u-trim">
index=perfmon_mk_disk_events<br />
| timechart span=15s avg(%_Disk_Read_Time)<br />
</div></div>
<div class="su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>perfmon_disk_metrics</div><div class="su-spoiler-content su-u-clearfix su-u-trim">
| mstats avg(_value) WHERE metric_name=&#8221;LogicalDisk.%_Disk_Read_Time&#8221; AND index=&#8221;perfmon_disk_metrics&#8221; span=15s<br />
</div></div>
<div class="su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>perfmon_mk_disk_metrics_mk</div><div class="su-spoiler-content su-u-clearfix su-u-trim">
| mstats avg(_value) WHERE metric_name=&#8221;%_Disk_Read_Time&#8221; AND index=&#8221;perfmon_mk_disk_metrics_mk&#8221; span=15s<br />
</div></div>
</div>



<h2 class="wp-block-heading">Test Results &#8211; 30 Minutes</h2>



<figure class="wp-block-table"><table><tbody><tr><td>Index</td><td>Event Count</td><td>Disk Size</td><td>License Usage</td></tr><tr><td>perfmon -&gt; events</td><td>10,856</td><td>572 KB</td><td>1,431 KB</td></tr><tr><td>perfmon -&gt; metrics</td><td>10,856 </td><td>516 KB</td><td>1,508 KB</td></tr><tr><td>perfmon_mk -&gt; events</td><td>118</td><td>292 KB</td><td>173 KB</td></tr><tr><td>perfmon_mk -&gt; metrics_mk</td><td>118</td><td>256 KB</td><td>16 KB</td></tr></tbody></table></figure>



<h4 class="wp-block-heading">PerfmonMK -&gt; MetricsMK Statistics</h4>



<figure class="wp-block-table"><table><tbody><tr><td>% License Decrease compared to Perfmon Events</td><td>98%</td></tr><tr><td>% License Decrease compared to Perfmon MK</td><td>90.7%</td></tr><tr><td>% Disk Usage Decrease compared to Perfmon Events</td><td>55%</td></tr><tr><td>% Disk Usage Decrease compared to Perfmon MK</td><td>12%</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Performance Results</h2>


<div class="su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed" data-scroll-offset="0" data-anchor-in-url="no"><div class="su-spoiler-title" tabindex="0" role="button"><span class="su-spoiler-icon"></span>Performance Testing - Raw Data</div><div class="su-spoiler-content su-u-clearfix su-u-trim">



<pre class="wp-block-code"><code class="">index=perfmon_disk_events instance=”C:” counter=”% Disk Read Time” | timechart span=15s avg(Value)
This search has completed and has returned 121 results by scanning 109 events in 0.132 seconds
This search has completed and has returned 121 results by scanning 109 events in 0.223 seconds
This search has completed and has returned 121 results by scanning 109 events in 0.136 seconds
This search has completed and has returned 121 results by scanning 109 events in 0.139 seconds
This search has completed and has returned 121 results by scanning 109 events in 0.122 seconds

index=perfmon_mk_disk_events | timechart span=15s avg(%_Disk_Read_Time)
This search has completed and has returned 121 results by scanning 109 events in 0.161 seconds
This search has completed and has returned 121 results by scanning 109 events in 0.159 seconds
This search has completed and has returned 121 results by scanning 109 events in 0.149 seconds
This search has completed and has returned 121 results by scanning 109 events in 0.142 seconds
This search has completed and has returned 121 results by scanning 109 events in 0.195 seconds

| mstats avg(_value) WHERE metric_name="LogicalDisk.%_Disk_Read_Time" AND index="perfmon_disk_metrics" span=15s
This search has completed and has returned 109 results by scanning 436 events in 0.079 seconds
This search has completed and has returned 109 results by scanning 436 events in 0.088 seconds
This search has completed and has returned 109 results by scanning 436 events in 0.081 seconds
This search has completed and has returned 109 results by scanning 436 events in 0.15 seconds
This search has completed and has returned 109 results by scanning 436 events in 0.087 seconds

| mstats avg(_value) WHERE metric_name=%_Disk_Read_Time AND index=perfmon_mk_disk_metrics_mk span=15s
This search has completed and has returned 109 results by scanning 109 events in 0.19 seconds
This search has completed and has returned 109 results by scanning 109 events in 0.076 seconds
This search has completed and has returned 109 results by scanning 109 events in 0.09 seconds
This search has completed and has returned 109 results by scanning 109 events in 0.158 seconds
This search has completed and has returned 109 results by scanning 109 events in 0.081 seconds</code></pre>


</div></div>



<figure class="wp-block-table"><table><tbody><tr><td>Index Name</td><td>Average Speed (Seconds)</td></tr><tr><td>perfmon_disk_events</td><td><strong>0.1504</strong></td></tr><tr><td>perfmon_mk_disk_events</td><td><strong>0.1612</strong> </td></tr><tr><td>perfmon_disk_metrics</td><td><strong>0.097</strong> </td></tr><tr><td>perfmon_mk_disk_metrics_mk</td><td><strong>0.119</strong></td></tr></tbody></table></figure>



<p><strong>Disclaimer: 30 minutes of data is not enough data to do a real-world comparison test.</strong></p>



<p>If you wanted an accurate test, I would recommend searching at least one month of data in an production system. These tests were performed on my local machine, and are subject to variances caused by other processes running in the background.</p>



<p>My conclusion:</p>



<p>Metrics are faster then events. I will not give a percentage here, because I do not feel enough data is present to create an accurate test of measuring performance.</p>



<h2 class="wp-block-heading">Conclusions</h2>



<p>In the <a href="https://xtremeownage.com/2020/01/splunk-8-metrics-vs-events/">original post</a>, the method used to convert Perfmon MK events to metrics was a pretty old method introduced in the Splunk infrastructure app a few years back. After making the post, Splunk&#8217;s engineering team reached out to me providing a lot of technical insight and documentation into the Metrics MK format.</p>



<p>After converting my tests to utilize the metrics MK format, I am completely blown away at the reduction in Licensing, and disk. Compared to the PerfmonMK format I am using in production currently, I can save over 90% on licensing, and over 10% on storage consumption by switching to a MUCH faster format, which is easier for users to ingest.</p>



<p>If you are interested in converting your perfmon data to metrics, I am in the process of finishing up a python script which will automatically build out the props.conf and transforms.conf to do so, with no manual configuration adjustments required.</p>



<p>If you are interested in contributing to this project, please visit the <a href="https://github.com/XtremeOwnage/Splunk-MetricsMK">github page here.</a></p>



<p>My two cents- If you are not in the process of converting your data to MetricsMK, You should be!!! I cannot express how much better the performance, license usage, and disk usage is compared to the out-of-the-box perfmon format.</p>



<p></p>



<h2 class="wp-block-heading">Documentation</h2>



<p>Metrics Overview:  <a href="https://docs.splunk.com/Documentation/Splunk/8.0.1/Metrics/Overview">https://docs.splunk.com/Documentation/Splunk/8.0.1/Metrics/Overview</a> </p>



<p>Using Multi-Value Metrics: <a href="https://docs.splunk.com/Documentation/Splunk/8.0.1/Metrics/GetMetricsInOther">https://docs.splunk.com/Documentation/Splunk/8.0.1/Metrics/GetMetricsInOther</a></p>



<p>Log to Metrics Overview:  <a href="https://docs.splunk.com/Documentation/Splunk/8.0.1/Metrics/L2MOverview">https://docs.splunk.com/Documentation/Splunk/8.0.1/Metrics/L2MOverview</a> </p>



<h2 class="wp-block-heading">Special Thanks</h2>



<p>I have received a lot of assistance from the Splunk team to provide this article. As such, I would like to call out their assistance.</p>



<ol><li>David Maislin @ Splunk has greatly assisted with issues related to Metrics, and has provided a lot of recommendations on putting together this content.</li><li>(More coming after I get their permission to post their names.)</li></ol>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Splunk – 8.0.1 Metrics vs Events Licensing Comparison</title>
		<link>https://xtremeownage.com/2020/01/07/splunk-8-metrics-vs-events/</link>
					<comments>https://xtremeownage.com/2020/01/07/splunk-8-metrics-vs-events/#comments</comments>
		
		<dc:creator><![CDATA[XO]]></dc:creator>
		<pubDate>Tue, 07 Jan 2020 19:41:40 +0000</pubDate>
				<category><![CDATA[Splunk]]></category>
		<category><![CDATA[Metrics]]></category>
		<category><![CDATA[splunk]]></category>
		<guid isPermaLink="false">https://xtremeownage.com/?p=819</guid>

					<description><![CDATA[Splunk 8.0.1 - Perfmon Metrics vs Events License/Disk Comparison.]]></description>
										<content:encoded><![CDATA[
<p>So- over a year back, when metrics was a new concept to Splunk, I ran a licensing and storage comparison <a href="https://xtremeownage.com/2018/10/splunk-7-2-metrics-vs-events-licensing-comparison/">HERE</a>.</p>



<p></p>



<p>Since Splunk has done many changes and improvements to how metrics are stored, and licensed, I felt it was time to run another comparison.<br></p>



<h2 class="wp-block-heading">How testing will be performed<br></h2>



<p>Most, if not all, of the test cases will be copied from the <a href="https://xtremeownage.com/2018/10/splunk-7-2-metrics-vs-events-licensing-comparison/">old tests.</a><br></p>



<p>For testing purposes, I will have three inputs, each pointing at their own separate index. Each of the inputs are configured exactly the same, with three variations.</p>



<ol><li>Regular Perfmon data. (Default for windows TA)</li><li>Perfmon MK format.</li><li>Perfmon as metrics</li></ol>



<p>For testing, I will be looking at the LogicalDisk perfmon, collecting data at a 15 second interval, with a very generous handful of metrics selected, to facilitate collecting a lot of data, rather quickly.</p>


[expand title=&#8221;Click To View Configuration Files&#8221;]



<h4 class="wp-block-heading">Inputs.conf</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="ini" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">[perfmon://LogicalDisk_Reg]
counters = % Free Space; Free Megabytes; Current Disk Queue Length; % Disk Time; Avg. Disk Queue Length; % Disk Read Time; Avg. Disk Read Queue Length; % Disk Write Time; Avg. Disk Write Queue Length; Avg. Disk sec/Transfer; Avg. Disk sec/Read; Avg. Disk sec/Write; Disk Transfers/sec; Disk Reads/sec; Disk Writes/sec; Disk Bytes/sec; Disk Read Bytes/sec; Disk Write Bytes/sec; Avg. Disk Bytes/Transfer; Avg. Disk Bytes/Read; Avg. Disk Bytes/Write; % Idle Time; Split IO/Sec
object = LogicalDisk
instances = *
disabled = 0
interval = 15
useEnglishOnly = true
index=Disk_PerfMon_Regular
showZeroValue=1
[perfmon://LogicalDisk_MK]
counters = % Free Space; Free Megabytes; Current Disk Queue Length; % Disk Time; Avg. Disk Queue Length; % Disk Read Time; Avg. Disk Read Queue Length; % Disk Write Time; Avg. Disk Write Queue Length; Avg. Disk sec/Transfer; Avg. Disk sec/Read; Avg. Disk sec/Write; Disk Transfers/sec; Disk Reads/sec; Disk Writes/sec; Disk Bytes/sec; Disk Read Bytes/sec; Disk Write Bytes/sec; Avg. Disk Bytes/Transfer; Avg. Disk Bytes/Read; Avg. Disk Bytes/Write; % Idle Time; Split IO/Sec
object = LogicalDisk
instances = *
disabled = 0
interval = 15
useEnglishOnly = true
index=Disk_PerfMon_MK
mode=multikv
showZeroValue=1
[perfmon://LogicalDisk_Metric]
counters = % Free Space; Free Megabytes; Current Disk Queue Length; % Disk Time; Avg. Disk Queue Length; % Disk Read Time; Avg. Disk Read Queue Length; % Disk Write Time; Avg. Disk Write Queue Length; Avg. Disk sec/Transfer; Avg. Disk sec/Read; Avg. Disk sec/Write; Disk Transfers/sec; Disk Reads/sec; Disk Writes/sec; Disk Bytes/sec; Disk Read Bytes/sec; Disk Write Bytes/sec; Avg. Disk Bytes/Transfer; Avg. Disk Bytes/Read; Avg. Disk Bytes/Write; % Idle Time; Split IO/Sec
object = LogicalDisk
instances = *
disabled = 0
interval = 15
useEnglishOnly = true
index=Disk_PerfMon_Metrics
showZeroValue=1</pre>



<h4 class="wp-block-heading">Transforms.conf</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="ini" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">[metrics-hostoverride]
DEST_KEY = MetaData:Host
REGEX = host=(\S+)
FORMAT = host::$1

[value]
REGEX = .*Value=(\S+).*
FORMAT = _value::$1
WRITE_META = true

[perfmon_metric_name]
REGEX = .*object=(\S+).*counter=(\S+).*
FORMAT = metric_name::$1.$2 metric_type::$1
WRITE_META = true

[instance]
REGEX = .*instance=(\S+).*
FORMAT = instance::$1
WRITE_META = true</pre>



<h4 class="wp-block-heading">Props.conf</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="ini" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">[source::Perfmon:*Metric]
TRANSFORMS-_value = value
TRANSFORMS-metric_name = perfmon_metric_name
TRANSFORMS-instance = instance
SEDCMD-remove-whitespace = s/ /_/g s/\s/ /g</pre>



<h4 class="wp-block-heading">Indexes.conf</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="ini" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">[disk_perfmon_regular]
coldPath = $SPLUNK_DB\disk_perfmon_regular\colddb
enableDataIntegrityControl = 0
enableTsidxReduction = 0
homePath = $SPLUNK_DB\disk_perfmon_regular\db
maxTotalDataSizeMB = 512000
thawedPath = $SPLUNK_DB\disk_perfmon_regular\thaweddb

[disk_perfmon_mk]
coldPath = $SPLUNK_DB\disk_perfmon_mk\colddb
enableDataIntegrityControl = 0
enableTsidxReduction = 0
homePath = $SPLUNK_DB\disk_perfmon_mk\db
maxTotalDataSizeMB = 512000
thawedPath = $SPLUNK_DB\disk_perfmon_mk\thaweddb

[disk_perfmon_metrics]
coldPath = $SPLUNK_DB\disk_perfmon_metrics\colddb
datatype = metric
enableDataIntegrityControl = 0
enableTsidxReduction = 0
homePath = $SPLUNK_DB\disk_perfmon_metrics\db
maxTotalDataSizeMB = 512000
thawedPath = $SPLUNK_DB\disk_perfmon_metrics\thaweddb
</pre>


[/expand]



<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Testing will be performed on a new install of Splunk enterprise 8.0.1, on my workstation. 32GB ram, xeon processor. (Don&#8217;t worry- I am already trying to get ahold of a Ryzen&#8230;.)</p>



<p>NO additional or 3rd party apps are installed.</p>



<p>If you would like to reproduce my results, you can do a fresh install of Splunk enterprise, and add the four configuration files listed above.</p>



<p>I added the configuration files, restarted Splunk, and took a lunch break.</p>



<p>When I returned, I disabled the inputs, and restarted Splunk, for a total of 25 minutes of testing.</p>



<p>Here are the results. The methods to obtain the data are below.</p>


[expand title=&#8221;Click to View Data Collection Methods&#8221;]



<h4 class="wp-block-heading">Event Count Query</h4>



<p>Just a quick count of events to ensure we are fairly grading the results.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| tstats count WHERE index=disk* groupby index 
| union 
    [| mstats count where index=disk* metric_name=* groupby index
        ]</pre>



<h4 class="wp-block-heading">Storage Usage</h4>



<p>Storage utilization was obtained in Windows explorer by manually going to C:\Program Files\Splunk\var\lib\splunk, right clicking the folders for each of the three indexes, and recording &#8220;Size on disk&#8221;</p>



<h4 class="wp-block-heading">License Utilization</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">index=_internal source="C:\\Program Files\\Splunk\\var\\log\\splunk\\license_usage.log"
| stats sum(b) as Size by idx
| eval Size= Size/1024</pre>


[/expand]



<h2 class="wp-block-heading">Test Results &#8211; 25 Minutes</h2>



<figure class="wp-block-table"><table><tbody><tr><td>Index</td><td>Event Count</td><td>Disk Size</td><td>License Usage</td></tr><tr><td> disk_perfmon_mk </td><td>100</td><td>248 KB</td><td>140 KB</td></tr><tr><td> disk_perfmon_regular </td><td>9,200 </td><td>492 KB</td><td>1,160 KB</td></tr><tr><td> disk_perfmon_metrics </td><td>9,200 </td><td>468 KB </td><td>1,239 KB</td></tr></tbody></table></figure>



<h4 class="wp-block-heading">Statistics</h4>



<figure class="wp-block-table"><table><tbody><tr><td>% Licensing Difference MK Vs Metrics</td><td>785%</td></tr><tr><td>% Disk Difference MK Vs Metrics</td><td>88.7%</td></tr></tbody></table></figure>



<h3 class="wp-block-heading">Further Testing</h3>



<p>At this point, I re-enabled the inputs, restarted Splunk, and started the stopwatch and let it run for 45 more minutes.</p>



<p>I am curious to see the trend with more data. While, I am 100% certain Perfmon MK will be the hands-down winner in all of these tests, I am curious to know the longer term results&#8230;.</p>



<h2 class="wp-block-heading">Test Results &#8211; 1 Hour</h2>



<figure class="wp-block-table"><table><tbody><tr><td>Index</td><td>Event Count</td><td>Disk Size</td><td>License Usage</td></tr><tr><td> disk_perfmon_mk </td><td>279</td><td>672 KB</td><td>403 KB</td></tr><tr><td> disk_perfmon_regular </td><td>25,668</td><td>724 KB </td><td>3,340 KB</td></tr><tr><td> disk_perfmon_metrics </td><td>25,668 </td><td>1,120 KB</td><td>3,569 KB</td></tr></tbody></table></figure>



<figure class="wp-block-table"><table><tbody><tr><td>% Licensing Difference MK Vs Metrics</td><td>785%</td></tr><tr><td>% Disk Difference MK Vs Metrics</td><td>66%</td></tr><tr><td>% Licensing Difference Perfmon Vs Metrics </td><td>7%</td></tr><tr><td>% Disk Difference Perfmon Vs Metrics </td><td>54%</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Conclusions</h2>



<p>I was under the impression the licensing of Metrics had been improved in Splunk 8&#8230; however- compared to the PerfmonMK format- there is additional room for improvement left.</p>



<p>While- I will still continue to utilize metrics for use-cases, mostly due to the ease of use&#8230; I would be cautious around converting your existing PerfmonMK data to Metrics.</p>



<p>If I apply the 785% increase in licensing to what I am collecting in my production environment, I would go from 3GB Daily, to 25GB Daily for my PerfmonMK traffic. While- this would only account for a ~1% increase in my daily licensing, it is still something to be aware of.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">index=index_utilization_summary st=PerfmonMK*
| stats sum(bytes) as TotalMKLicense 
| eval Total_MK_GB = TotalMKLicense / 1024 / 1024 / 1024 
| eval Total_Metrics_GB = (TotalMKLicense*7.85) / 1024 / 1024 / 1024

* If I performed the above math incorrectly, please let me know! *</pre>



<p>In my opinion, the additional speed, performance, and usability of metrics would likely outweigh the 1% impact to <span style="text-decoration: underline;">MY</span> licensing. However, for customers licensed for 100-500GB, this impact would be far more considerable.</p>



<p>If you are currently using the regular Perfmon format, instead of PerfmonMK, I would recommend to considering changing your collections to instead use metrics, as it is only a 7% difference in licensing. I also anticipate the metric&#8217;s disk usage difference will also reduce as the indexes grow.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://xtremeownage.com/2020/01/07/splunk-8-metrics-vs-events/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
		<item>
		<title>Splunk &#8211; 8.0 &#8211; Restrict SourceTypes for Roles</title>
		<link>https://xtremeownage.com/2019/10/22/splunk-8-0-restrict-sourcetypes-for-roles/</link>
		
		<dc:creator><![CDATA[XO]]></dc:creator>
		<pubDate>Tue, 22 Oct 2019 20:36:34 +0000</pubDate>
				<category><![CDATA[Splunk]]></category>
		<guid isPermaLink="false">https://xtremeownage.com/?p=720</guid>

					<description><![CDATA[Summary One issue that gets thrown around alot, is being able to restrict users to specific sourcetypes, in certain indexes. While- this feature was possible in earlier versions, it was...]]></description>
										<content:encoded><![CDATA[
<h4 class="wp-block-heading">Summary</h4>



<p>One issue that gets thrown around alot, is being able to restrict users to specific sourcetypes, in certain indexes.</p>



<p>While- this feature was <a href="https://docs.splunk.com/Documentation/Splunk/7.0.0/Security/Addandeditroles#Search_filter_format">possible in earlier versions</a>, it was very clumsy, and could be difficult to maintain&#8230; and had potential security concerns due to its implementation.</p>



<p>With the release of <a href="https://docs.splunk.com/Documentation/Splunk/latest/ReleaseNotes/MeetSplunk#What.27s_New_in_8.0">Splunk 8.0.0</a>&#8211; It appears significant improvements have been made to this process, which would make it much more feasible in a production environment.</p>



<p>With a bit of research- the new controls appear to be more optimized, and easier to maintain.</p>



<p>Here is the <a href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Security/Addandeditroles#Specify_search_restrictions_for_a_role">documentation for the configuration of this new functionality. </a></p>



<h4 class="wp-block-heading">Caveats</h4>



<ol><li><a href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Security/Addandeditroles#Caveats_to_using_the_SPL_search_filter">These restrictions do not apply to metrics data.</a></li><li>This only applies to filtering by indexed fields</li></ol>



<h4 class="wp-block-heading">Pros</h4>



<ol><li>This means you can filter a role to specific sourcetypes / sources within an index, securely.</li></ol>



<h2 class="wp-block-heading">Lets test!</h2>



<p>For my test- I created user &#8220;testuser&#8221;, with role &#8220;user-testuser&#8221;</p>



<h4 class="wp-block-heading">Test 1: Filter out a specific sourcetype for all users, but, allow test-user access</h4>



<p>My first task, is to set a restriction on the user&#8217;s role to deny access to index=_internal, sourcetype=mongod</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">NOT (index::_internal AND sourcetype::mongod)</pre>



<p>As expected, my test-user can no longer see the mongod sourcetype.</p>



<figure class="wp-block-image"><a href="https://xtremeownage.com/wp-content/uploads/2019/10/data1.png" rel="prettyPhoto[gallery-9xOk]"><img loading="lazy" decoding="async" width="1897" height="646" src="https://i2.wp.com/xtremeownage.com/wp-content/uploads/2019/10/data1.png?fit=1024%2C349&amp;ssl=1" alt="" class="wp-image-722" srcset="https://xtremeownage.com/wp-content/uploads/2019/10/data1.png 1897w, https://xtremeownage.com/wp-content/uploads/2019/10/data1-300x102.png 300w, https://xtremeownage.com/wp-content/uploads/2019/10/data1-768x262.png 768w, https://xtremeownage.com/wp-content/uploads/2019/10/data1-1024x349.png 1024w" sizes="(max-width: 1897px) 100vw, 1897px" /></a></figure>



<p>Here is the generated search, pulled from the searchlog</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| tstats prestats=t local=f summariesonly=f allow_old_summaries=f chunk_size=10000000 count where ((index=* OR index=_*) (NOT sourcetype::mongod OR NOT index::_internal)) groupby index sourcetype</pre>



<p>Something which confuses me about the generated search, is this line: (NOT sourcetype::mongod OR NOT index::_internal). However- it does work as we configured it&#8230; oddly.</p>



<p>But- the expanded filtering search looks as expected</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">( ( ( index=* OR index=_* ) ( NOT sourcetype::mongod OR NOT index::_internal ) ) ) ( ( NOT ( sourcetype::mongod AND index::_internal ) ) )</pre>



<p>So- next, lets see if we can override this rule using inheritance. On a hunch- I decided to see how it would appear in a search.</p>



<figure class="wp-block-image"><a href="https://xtremeownage.com/wp-content/uploads/2019/10/spl_filter.png" rel="prettyPhoto[gallery-9xOk]"><img loading="lazy" decoding="async" width="577" height="588" src="https://xtremeownage.com/wp-content/uploads/2019/10/spl_filter.png" alt="" class="wp-image-723" srcset="https://xtremeownage.com/wp-content/uploads/2019/10/spl_filter.png 577w, https://xtremeownage.com/wp-content/uploads/2019/10/spl_filter-294x300.png 294w" sizes="(max-width: 577px) 100vw, 577px" /></a></figure>



<figure class="wp-block-image"><a href="https://xtremeownage.com/wp-content/uploads/2019/10/spl.png" rel="prettyPhoto[gallery-9xOk]"><img loading="lazy" decoding="async" width="450" height="88" src="https://xtremeownage.com/wp-content/uploads/2019/10/spl.png" alt="" class="wp-image-724" srcset="https://xtremeownage.com/wp-content/uploads/2019/10/spl.png 450w, https://xtremeownage.com/wp-content/uploads/2019/10/spl-300x59.png 300w" sizes="(max-width: 450px) 100vw, 450px" /></a></figure>



<p>It appears to just append the  SPL filters for each role, starting with the highest role first. As a result, it does not look like you will be able to override the SPL filter based on inheritance. </p>



<h2 class="wp-block-heading">Summary</h2>



<p>With the new improvements, you can more easily filter out subsets of your data on fields such as source, sourcetype, or other indexed fields. This functionality did exist before, but, a well-crafted search could bypass the filter. </p>



<p>The additional UI features will make it easier to add additional rules to this new feature. While this is not a completely new feature, the subtle improvements are well welcomed.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Splunk &#8211; 8.0 Upgrade &#8211; SplunkWeb Not Running</title>
		<link>https://xtremeownage.com/2019/10/22/splunk-8-0-upgrade-splunkweb-not-running/</link>
		
		<dc:creator><![CDATA[XO]]></dc:creator>
		<pubDate>Tue, 22 Oct 2019 16:11:33 +0000</pubDate>
				<category><![CDATA[Splunk]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[splunk]]></category>
		<guid isPermaLink="false">https://xtremeownage.com/?p=717</guid>

					<description><![CDATA[Correcting an issue preventing Splunk from starting after upgrading to version 8.0.0]]></description>
										<content:encoded><![CDATA[
<p>So-</p>



<p>Since Splunk version 8.0 was dropped earlier today, I decided to upgrade my DEV environment to start playing with the latest additions and changes.</p>



<h2 class="wp-block-heading">Links and References</h2>



<p><a href="https://docs.splunk.com/Documentation/Splunk/latest/ReleaseNotes/MeetSplunk">Splunk 8.0.0 Release Notes</a></p>



<p><a href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Installation/AboutupgradingREADTHISFIRST">Before Upgrading &#8211; Notes </a></p>



<h2 class="wp-block-heading">The problem</h2>



<p>However- after running the upgrade, I quickly ran into this issue, found in web_service.log, preventing SplunkWeb from starting properly.</p>



<h4 class="wp-block-heading">web_service.log</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="32" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">2019-10-22 10:45:25,928 INFO    [5daf2415ae7f3323106710] __init__:174 - Using default logging config file: /opt/splunk/etc/log.cfg
2019-10-22 10:45:25,935 INFO    [5daf2415ae7f3323106710] __init__:212 - Setting logger=splunk level=INFO
2019-10-22 10:45:25,935 INFO    [5daf2415ae7f3323106710] __init__:212 - Setting logger=splunk.appserver level=INFO
2019-10-22 10:45:25,935 INFO    [5daf2415ae7f3323106710] __init__:212 - Setting logger=splunk.appserver.controllers level=INFO
2019-10-22 10:45:25,935 INFO    [5daf2415ae7f3323106710] __init__:212 - Setting logger=splunk.appserver.controllers.proxy level=INFO
2019-10-22 10:45:25,935 INFO    [5daf2415ae7f3323106710] __init__:212 - Setting logger=splunk.appserver.lib level=WARN
2019-10-22 10:45:25,935 INFO    [5daf2415ae7f3323106710] __init__:212 - Setting logger=splunk.pdfgen level=INFO
2019-10-22 10:45:25,935 INFO    [5daf2415ae7f3323106710] __init__:212 - Setting logger=splunk.archiver_restoration level=INFO
2019-10-22 10:45:26,259 ERROR   [5daf2415ae7f3323106710] root:769 - Unable to start splunkweb
2019-10-22 10:45:26,259 ERROR   [5daf2415ae7f3323106710] root:770 - No module named 'UserDict'
Traceback (most recent call last):
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/root.py", line 132, in &lt;module>
    from splunk.appserver.mrsparkle.controllers.top import TopController
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/controllers/top.py", line 27, in &lt;module>
    from splunk.appserver.mrsparkle.controllers.admin import AdminController
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/controllers/admin.py", line 25, in &lt;module>
    from splunk.appserver.mrsparkle.controllers.appinstall import AppInstallController
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/controllers/appinstall.py", line 22, in &lt;module>
    from splunk.appserver.mrsparkle.lib import module
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/lib/module.py", line 465, in &lt;module>
    moduleMapper = ModuleMapper()
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/lib/module.py", line 83, in __init__
    self.installedModules = self.getInstalledModules()
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/lib/module.py", line 28, in helper
    return f(*a, **kw)
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/lib/module.py", line 448, in getInstalledModules
    mods = self.getModuleList(root)
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/lib/module.py", line 37, in helper
    return f(*a, **kw)
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/lib/module.py", line 223, in getModuleList
    mod = __import__(modname)
  File "/opt/splunk/etc/apps/search_activity/appserver/modules/D3DynamicTree/D3DynamicTree.py", line 5, in &lt;module>
    import UserDict
ModuleNotFoundError: No module named 'UserDict'
</pre>



<p>So, the first troubleshooting step I will perform- is to reinstall the .rpm, just in case.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo rpm --reinstall ~/splunk-8.0.0-1357bef0a7f6-linux-2.6-x86_64.rpm
splunk start
splunk status</pre>



<p>Of course- that did not resolve the issue. The biggest issue which stands out in the logs, is &#8220;ModuleNotFoundError: No module named &#8216;UserDict'&#8221;</p>



<p>So- since I see references to the <a href="https://splunkbase.splunk.com/app/2632/">search_activity</a> app, I removed the app and restarted Splunk.</p>



<p></p>



<p>Voila, Problem resolved. Perhaps somebody will find some use in this article.</p>



<h4 class="wp-block-heading">Update- the <a href="https://splunkbase.splunk.com/app/2632/">search_activit</a>y app was updated for Splunk 8.0</h4>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Splunk – RGB Value Based on Percentage &#8211; Part 2</title>
		<link>https://xtremeownage.com/2019/09/30/splunk-rgb-value-based-on-percentage-part-2/</link>
		
		<dc:creator><![CDATA[XO]]></dc:creator>
		<pubDate>Mon, 30 Sep 2019 13:27:56 +0000</pubDate>
				<category><![CDATA[Splunk]]></category>
		<guid isPermaLink="false">https://xtremeownage.com/?p=370</guid>

					<description><![CDATA[Splunk - Generating a RGB hex color code based on results.]]></description>
										<content:encoded><![CDATA[
<p>This is an updated version of <a href="https://xtremeownage.com/2019/04/splunk-rgb-value-based-on-percentage/">Part 1</a> updated with feedback provided by this <a href="https://www.reddit.com/r/Splunk/comments/dapqmz/splunk_rgb_value_based_on_percentage/">Reddit post</a>.</p>



<p>FIrst of all- I will include a working example in this post, assuming you utilize the <a href="https://splunkbase.splunk.com/app/3124/">Maps+</a> Plugin. If you do not leverage this plugin- I strongly recommend you take a look. It is actively developed by one of Splunk&#8217;s employees, and is loaded with useful features.</p>



<p>Step 1. Create &#8220;Sample&#8221; data. If you intend on using this with your data, you may leave this step out.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| makeresults count=100 </pre>



<p>Step 2. Calculate a &#8220;Percent&#8221; column.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| eventstats count as total 
| streamstats count as pos 
| eval pct = ROUND(pos/total*100,0) </pre>



<p>Step 3. Generate a dummy latitude and longitude based on the data. I just need to demonstrate a straight line&#8230;. If you are using your own data, leave this step out.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| eval latitude=pct * 0.10, longitude=0 </pre>



<p>Step 4. Generate the &#8220;Color Curve&#8221;. This implementation starts at green, and ends with red. If you want to change the colors, tweak this line.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| eval C_r=IF(pct&lt;50, 255, 510-5.10*pct), C_g=IF(pct&lt;50, 5.1*pct, 255), C_b=0 </pre>



<p>Step 5. Here is the condensed version of my original method, using foreach, instead of one eval per color channel.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| foreach C_* 
    [| eval &lt;&lt;FIELD>>= REPLACE(tostring(ROUND(&lt;&lt;FIELD>>, 0),"hex"), "0x", "") 
    | eval &lt;&lt;FIELD>>=substr("00", 0, max(2-len(&lt;&lt;FIELD>>), 0)).&lt;&lt;FIELD>>] </pre>



<p>Step 6. Generate a hex color code.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| eval circleColor="#".C_r.C_g.C_b</pre>



<p>Step 7. Formatting. I am piping everything to a table out. markerType=&#8221;Circle&#8221; changes how the icons are formatted.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| eval markerType="circle" 
| table pct latitude longitude circleColor markerType</pre>



<p>Here is the finished product:</p>



<figure class="wp-block-image"><a href="https://xtremeownage.com/wp-content/uploads/2019/09/Color_Example.png" rel="prettyPhoto[gallery-eW0B]"><img loading="lazy" decoding="async" width="1815" height="584" src="https://i1.wp.com/xtremeownage.com/wp-content/uploads/2019/09/Color_Example.png?fit=1024%2C329&amp;ssl=1" alt="" class="wp-image-371" srcset="https://xtremeownage.com/wp-content/uploads/2019/09/Color_Example.png 1815w, https://xtremeownage.com/wp-content/uploads/2019/09/Color_Example-300x97.png 300w, https://xtremeownage.com/wp-content/uploads/2019/09/Color_Example-768x247.png 768w, https://xtremeownage.com/wp-content/uploads/2019/09/Color_Example-1024x329.png 1024w" sizes="(max-width: 1815px) 100vw, 1815px" /></a></figure>



<p>Here is the full query I used for this example.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| makeresults count=100 
| eventstats count as total 
| streamstats count as pos 
| eval pct = ROUND(pos/total*100,0) 
| eval latitude=pct * 0.10, longitude=0 
| eval C_r=IF(pct&lt;50, 255, 510-5.10*pct), C_g=IF(pct&lt;50, 5.1*pct, 255), C_b=0 
| foreach C_* 
    [| eval &lt;&lt;FIELD>>= REPLACE(tostring(ROUND(&lt;&lt;FIELD>>, 0),"hex"), "0x", "") 
    | eval &lt;&lt;FIELD>>=substr("00", 0, max(2-len(&lt;&lt;FIELD>>), 0)).&lt;&lt;FIELD>>] 
| eval circleColor="#".C_r.C_g.C_b
| eval markerType="circle" 
| table pct latitude longitude circleColor markerType</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Splunk &#8211; RGB Value Based on Percentage</title>
		<link>https://xtremeownage.com/2019/04/08/splunk-rgb-value-based-on-percentage/</link>
					<comments>https://xtremeownage.com/2019/04/08/splunk-rgb-value-based-on-percentage/#comments</comments>
		
		<dc:creator><![CDATA[XO]]></dc:creator>
		<pubDate>Tue, 09 Apr 2019 02:56:27 +0000</pubDate>
				<category><![CDATA[Splunk]]></category>
		<guid isPermaLink="false">https://xtremeownage.com/?p=340</guid>

					<description><![CDATA[Splunk - Calculating a RGB value based on a percentage.]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading"><a href="https://xtremeownage.com/2019/09/splunk-rgb-value-based-on-percentage-part-2/">Note, please read part 2 instead for a improved query, with better examples!!!</a></h3>



<p> So- I had a need to calculate a RGB value based on the percentage total progress. My specific need was to color-code a vehicles route on a map by the time. </p>



<p>Here is how I accomplished it.</p>



<p>First, we need to calculate the percentage complete. Your implementation may vary. However- this basic use case will calculate a percentage for most queries.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| eventstats count as total 
| streamstats count as pos 
| eval pct = ROUND(pos/total*100,0)</pre>



<p> Next, I needed to calculate the RGB value. My implementation goes from red(0%) to green(100%). </p>



<p>If you wanted to tweak the colors, this would be the line to modify.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">| eval r=IF(pct&lt;50, 255, 510-5.10*pct), g=IF(pct&lt;50, 5.1*pct, 255), b=0</pre>



<p> Next, is this ugly block of commands, to convert the RGB values, into a single hex value. If you find a better way to manage this- please let me know.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">## Round the values. Cannot convert decimals to hex.
| eval r=ROUND(r,0), g=ROUND(g,0), b=ROUND(b,0)
## Replace the 0x with empty.
| eval rH=REPLACE(tostring(r,"hex"), "0x", ""),gH=REPLACE(tostring(g,"hex"), "0x", ""), bH=REPLACE(tostring(b,"hex"), "0x", "")
## Ensure each "grouping" is two characters long.
| eval rH=substr("00", 0, max(2-len(rH), 0)).rH, gH=substr("00", 0, max(2-len(gH), 0)).gH, bH=substr("00", 0, max(2-len(bH), 0)).bH 
## Combine the hex segments
| eval circleColor="#".rH.gH.bH</pre>



<p>Here is the color curve generated. </p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="800" height="112" src="https://xtremeownage.com/wp-content/uploads/2019/09/ColorCurve.png" alt="" class="wp-image-342" srcset="https://xtremeownage.com/wp-content/uploads/2019/09/ColorCurve.png 800w, https://xtremeownage.com/wp-content/uploads/2019/09/ColorCurve-300x42.png 300w, https://xtremeownage.com/wp-content/uploads/2019/09/ColorCurve-768x108.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://xtremeownage.com/2019/04/08/splunk-rgb-value-based-on-percentage/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Splunk &#8211; 7.2 Metrics vs Events Licensing Comparison</title>
		<link>https://xtremeownage.com/2018/10/19/splunk-7-2-metrics-vs-events-licensing-comparison/</link>
		
		<dc:creator><![CDATA[XO]]></dc:creator>
		<pubDate>Sat, 20 Oct 2018 03:00:52 +0000</pubDate>
				<category><![CDATA[Splunk]]></category>
		<guid isPermaLink="false">https://xtremeownage.com/?p=347</guid>

					<description><![CDATA[A license comparison for metrics vs events in Splunk 7.2]]></description>
										<content:encoded><![CDATA[
<p> </p>



<h4 class="wp-block-heading">The below article has been superseded.</h4>



<p></p>



<p>Please <a href="https://xtremeownage.com/2020/02/splunk-8-0-1-metrics-vs-events-licensing-comparison-updated-with-metrics-mk/">click here</a> to view the newly updated article for Splunk 8.0.2</p>



<div style="height:585px" aria-hidden="true" class="wp-block-spacer"></div>



<p></p>



<p>So, three months ago, I had a hunch that metrics would result in significantly higher license utilization.</p>



<p>My theory was posted to Reddit&nbsp;<a href="https://www.reddit.com/r/Splunk/comments/8zvlfw/splunk_metrics_license_usage_windows_metrics/" target="_blank" rel="noreferrer noopener">HERE</a>:</p>



<p>Since&#8230; Splunk 7.2 added numerous improvements to how metrics are handled and searched,<br>Today, I am going to go through the process of testing this theory, and provide my results.</p>



<p>For testing purposes, I will have three inputs, each pointing at their own separate index. Each of the inputs are configured exactly the same, with three variations.</p>



<p></p>



<ol><li>Regular Perfmon data.</li><li>Perfmon MK format.</li><li>Perfmon as metrics</li></ol>



<p>For testing, I will be looking at the LogicalDisk perfmon, collecting data at a 15 second interval, with a very generous handful of metrics selected, to facilitate collecting a lot of data, rather quickly.</p>



<h4 class="wp-block-heading">Inputs.Conf </h4>



<pre class="EnlighterJSRAW" data-enlighter-language="ini" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">[perfmon://LogicalDisk_Reg]
counters = % Free Space; Free Megabytes; Current Disk Queue Length; % Disk Time; Avg. Disk Queue Length; % Disk Read Time; Avg. Disk Read Queue Length; % Disk Write Time; Avg. Disk Write Queue Length; Avg. Disk sec/Transfer; Avg. Disk sec/Read; Avg. Disk sec/Write; Disk Transfers/sec; Disk Reads/sec; Disk Writes/sec; Disk Bytes/sec; Disk Read Bytes/sec; Disk Write Bytes/sec; Avg. Disk Bytes/Transfer; Avg. Disk Bytes/Read; Avg. Disk Bytes/Write; % Idle Time; Split IO/Sec
object = LogicalDisk
instances = *
disabled = 0
interval = 15
useEnglishOnly = true
index=Disk_PerfMon_Regular
showZeroValue=1

[perfmon://LogicalDisk_MK]
counters = % Free Space; Free Megabytes; Current Disk Queue Length; % Disk Time; Avg. Disk Queue Length; % Disk Read Time; Avg. Disk Read Queue Length; % Disk Write Time; Avg. Disk Write Queue Length; Avg. Disk sec/Transfer; Avg. Disk sec/Read; Avg. Disk sec/Write; Disk Transfers/sec; Disk Reads/sec; Disk Writes/sec; Disk Bytes/sec; Disk Read Bytes/sec; Disk Write Bytes/sec; Avg. Disk Bytes/Transfer; Avg. Disk Bytes/Read; Avg. Disk Bytes/Write; % Idle Time; Split IO/Sec
object = LogicalDisk
instances = *
disabled = 0
interval = 15
useEnglishOnly = true
index=Disk_PerfMon_MK
mode=multikv
showZeroValue=1

[perfmon://LogicalDisk_Metric]
counters = % Free Space; Free Megabytes; Current Disk Queue Length; % Disk Time; Avg. Disk Queue Length; % Disk Read Time; Avg. Disk Read Queue Length; % Disk Write Time; Avg. Disk Write Queue Length; Avg. Disk sec/Transfer; Avg. Disk sec/Read; Avg. Disk sec/Write; Disk Transfers/sec; Disk Reads/sec; Disk Writes/sec; Disk Bytes/sec; Disk Read Bytes/sec; Disk Write Bytes/sec; Avg. Disk Bytes/Transfer; Avg. Disk Bytes/Read; Avg. Disk Bytes/Write; % Idle Time; Split IO/Sec
object = LogicalDisk
instances = *
disabled = 0
interval = 15
useEnglishOnly = true
index=Disk_PerfMon_Metrics
showZeroValue=1</pre>



<h4 class="wp-block-heading"> Transforms.conf, unmodified from Splunk_TA_Infrastructure</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="ini" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">########### Metrics ######################
[metrics-hostoverride]
DEST_KEY = MetaData:Host
REGEX = host=(\S+)
FORMAT = host::$1


########### Transforms for Windows ######################
[value]
REGEX = .*Value=(\S+).*
FORMAT = _value::$1
WRITE_META = true

# Example: object=PhysicalDisk counter="%_Disk_Write_Time"
# Transform - metric_name::PhysicalDisk.%_Disk_Write_Time
[perfmon_metric_name]
REGEX = .*object=(\S+).*counter=(\S+).*
FORMAT = metric_name::$1.$2 metric_type::$1
WRITE_META = true

[instance]
REGEX = .*instance=(\S+).*
FORMAT = instance::$1
WRITE_META = true
Props.conf
INI:
[source::Perfmon:*Metric]
TRANSFORMS-_value = value
TRANSFORMS-metric_name = perfmon_metric_name
TRANSFORMS-instance = instance
SEDCMD-remove-whitespace = s/ /_/g s/\s/ /g</pre>



<p>

Testing was performed on a fresh install of Splunk enterprise 7.2, on my windows 10 workstation.</p>



<p>All inputs and indexes were enabled/created while Splunk was disabled, to prevent any of the methods from having skewed results.</p>



<p>While, the overall data collection interval was rather short, the data is conclusive to backup my original theory.</p>



<p>A few notes-</p>



<p></p>



<ul><li>For every single perfmonMK event collected, there are 92 separate metric/normal perfmon events collected.</li><li>I did not collect enough data to properly assess the claimed performance benefits for using metrics, over events. This test was purely from the standpoint of license and disk utilization.</li><li>Splunk did recently release an&nbsp;<a href="https://splunkbase.splunk.com/app/4192/" target="_blank" rel="noreferrer noopener">APP</a>&nbsp;for browsing and displaying metrics. This app performs extremely well, and, in my opinion, makes it extremely easy for end users of the platform to consume metric data and create dashboards.<ul><li>As a note- The app does also perform with normal, accelerated datasets very effectively. If you are like me, and have previously created a datasets for end users to consume performance data with, it works very well for that.</li></ul></li></ul>



<p>My list of CONs for metrics so far<br></p>



<ul><li>Ignoring the license utilization theory which will be evaluated below&#8230;</li><li>One HUGE downside so far, is the inability to do automatic lookups to the data, or to enrich the data with more sources. From my understanding, the dimensions will need to be added during index time.<ul><li>Good example: I have a lookup called &#8220;HostInformation&#8221; which, contains a lot of CMDB-related information. What applications the server belongs to, if its production or non-production, the OS version, etc. I have not found a meaningful method of utilizing this data WITH metrics, at least in the context of the metrics explorer.</li></ul></li></ul>



<p> After 10 minutes of testing, here are the results.</p>



<p>Total size on disk:<br>disk_perfmon_metrics &#8212; 0.14 MB<br>disk_perfmon_mk &#8212; 0.10 MB<br>disk_perfmon_regular &#8212; 0.20 MB</p>



<p>Perfmon MK is the clear winner, with metrics in 2nd place by a healthy margin.</p>



<p>License Utilization:</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="560" height="127" src="https://xtremeownage.com/wp-content/uploads/2019/09/LicenseSizeComparison.png" alt="" class="wp-image-348" srcset="https://xtremeownage.com/wp-content/uploads/2019/09/LicenseSizeComparison.png 560w, https://xtremeownage.com/wp-content/uploads/2019/09/LicenseSizeComparison-300x68.png 300w" sizes="(max-width: 560px) 100vw, 560px" /></figure>



<p>

As expected, Perfmon:MK is a clear winner by a MASSIVE margin.</p>



<p>Here are the results from the Indexes viewer in Splunk:</p>



<p>(Sorry the picture is greyed out, I shut splunk down before collecting the test results)

</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="800" height="55" src="https://xtremeownage.com/wp-content/uploads/2019/09/Index-Viewer.png" alt="" class="wp-image-349" srcset="https://xtremeownage.com/wp-content/uploads/2019/09/Index-Viewer.png 800w, https://xtremeownage.com/wp-content/uploads/2019/09/Index-Viewer-300x21.png 300w, https://xtremeownage.com/wp-content/uploads/2019/09/Index-Viewer-768x53.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></figure>



<p>

My summary: I recommend to continue using perfmon:MK format, and wrapping the results into an accelerated dataset for consumption by the end users. The data model acceleration will greatly improve the performance, while the multikey format will significantly reduce the amount of license required.</p>



<p>At which time a few other improvements are made around metrics, I will evaluate if it is worth making the switch, at the expense of increased license utilization.</p>



<p>For me- License usage is important, because I collect hundreds of counters, from thousands of devices, at very regular intervals. </p>



<p></p>



<p></p>



<p><br></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
