<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to collect perf counters of type average or per second? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90630#M18821</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;When collecting performance metrics from a local machine, you should not use splunk-wmi. You should use splunk-perfmon. Splunk-perfmon attaches directly to PDH to poll the performance objects and counters directly.&lt;/P&gt;

&lt;P&gt;In any case, whenever you use WQL, your query must be syntactically correct, including case, punctuation and spacing. Failure to maintain a correct WQL query structure will result in no data being returned.&lt;/P&gt;

&lt;P&gt;Just to make sure that this was not a bug, I tested your WQL query with WBEMTEST. It returns the same results.&lt;/P&gt;

&lt;P&gt;More information on collecting performance metrics is here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Real-timeWindowsperformancemonitoring"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Real-timeWindowsperformancemonitoring&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Cheers.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Mar 2012 14:45:42 GMT</pubDate>
    <dc:creator>malmoore</dc:creator>
    <dc:date>2012-03-14T14:45:42Z</dc:date>
    <item>
      <title>How to collect perf counters of type average or per second?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90627#M18818</link>
      <description>&lt;P&gt;Hi Everybody,&lt;/P&gt;

&lt;P&gt;I have a WMI Perf counter query that always returns zero in splunk-wmi.exe for counters with the following types: average and per second.&lt;/P&gt;

&lt;P&gt;I run the folowing command:&lt;/P&gt;

&lt;P&gt;D:\Splunk\bin&amp;gt;splunk-wmi -wql "SELECT Name, DiskReadBytesPerSec, AvgDiskQueueLength FROM Win32_PerfFormattedData_PerfDisk_PhysicalDisk"&lt;/P&gt;

&lt;P&gt;And get the following output:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;SPLUNK&lt;/EM&gt;&lt;/STRONG&gt; index= source="WMI:unspecified" sourcetype="WMI:unspecified"&lt;/P&gt;

&lt;P&gt;---splunk-wmi-end-of-event---&lt;BR /&gt;
20120313033326.660213&lt;BR /&gt;
AvgDiskQueueLength=0&lt;BR /&gt;
DiskReadBytesPersec=0&lt;BR /&gt;
Name=0 C: &lt;span class="lia-unicode-emoji" title=":anguished_face:"&gt;😧&lt;/span&gt;&lt;BR /&gt;
wmi_type=unspecified&lt;/P&gt;

&lt;P&gt;---splunk-wmi-end-of-event---&lt;BR /&gt;
&lt;STRONG&gt;&lt;EM&gt;SPLUNK&lt;/EM&gt;&lt;/STRONG&gt; index= source="WMI:unspecified" sourcetype="WMI:unspecified"&lt;/P&gt;

&lt;P&gt;---splunk-wmi-end-of-event---&lt;BR /&gt;
20120313033326.660213&lt;BR /&gt;
AvgDiskQueueLength=0&lt;BR /&gt;
DiskReadBytesPersec=0&lt;BR /&gt;
Name=_Total&lt;BR /&gt;
wmi_type=unspecified&lt;/P&gt;

&lt;P&gt;---splunk-wmi-end-of-event---&lt;/P&gt;

&lt;P&gt;System utility perfmon.exe indicate that the values for these counters are constantly changing.&lt;/P&gt;

&lt;P&gt;How to collect these perf counters?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90627#M18818</guid>
      <dc:creator>donhuanmatus</dc:creator>
      <dc:date>2020-09-28T11:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to collect perf counters of type average or per second?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90628#M18819</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;From the looks of things it appears that your splunk-wmi command is not attaching to WMI properly.&lt;/P&gt;

&lt;P&gt;At the very least, Splunk needs to run as a user that has access to WMI. It also needs to be correctly configured to connect to WMI.&lt;/P&gt;

&lt;P&gt;Review the following documentation at your leisure for specifics about how to attach to WMI sources to get data:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/MonitorWMIdata"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/MonitorWMIdata&lt;/A&gt; (for information on how to connect to WMI sources to get data from WMI)&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Real-timeWindowsperformancemonitoring"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Real-timeWindowsperformancemonitoring&lt;/A&gt; (to learn how to use Splunk's performance monitoring tools, which use WMI-based inputs in some situations)&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/ConsiderationsfordecidinghowtomonitorWindowsdata"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/ConsiderationsfordecidinghowtomonitorWindowsdata&lt;/A&gt; (for general information on monitoring remote Windows data)&lt;/P&gt;

&lt;P&gt;Cheers.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2012 16:32:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90628#M18819</guid>
      <dc:creator>malmoore</dc:creator>
      <dc:date>2012-03-13T16:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to collect perf counters of type average or per second?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90629#M18820</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;

&lt;P&gt;Splunk-WMI command is correctly attached to WMI.&lt;/P&gt;

&lt;P&gt;This confirms the successful execution of the following query:&lt;/P&gt;

&lt;P&gt;D:\Splunk\bin&amp;gt;splunk-wmi -wql "SELECT Name, PercentDiskTime FROM Win32_PerfFormattedData_PerfDisk_PhysicalDisk WHERE Name = '_Total'"&lt;BR /&gt;
&lt;STRONG&gt;&lt;EM&gt;SPLUNK&lt;/EM&gt;&lt;/STRONG&gt; index= source="WMI:unspecified" sourcetype="WMI:unspecified"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;---splunk-wmi-end-of-event---
20120314072433.340459
Name=_Total
PercentDiskTime=28
wmi_type=unspecified

---splunk-wmi-end-of-event---
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem with collecting perf counters of type average and per second.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:30:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90629#M18820</guid>
      <dc:creator>donhuanmatus</dc:creator>
      <dc:date>2020-09-28T11:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to collect perf counters of type average or per second?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90630#M18821</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;When collecting performance metrics from a local machine, you should not use splunk-wmi. You should use splunk-perfmon. Splunk-perfmon attaches directly to PDH to poll the performance objects and counters directly.&lt;/P&gt;

&lt;P&gt;In any case, whenever you use WQL, your query must be syntactically correct, including case, punctuation and spacing. Failure to maintain a correct WQL query structure will result in no data being returned.&lt;/P&gt;

&lt;P&gt;Just to make sure that this was not a bug, I tested your WQL query with WBEMTEST. It returns the same results.&lt;/P&gt;

&lt;P&gt;More information on collecting performance metrics is here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Real-timeWindowsperformancemonitoring"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Real-timeWindowsperformancemonitoring&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Cheers.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2012 14:45:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90630#M18821</guid>
      <dc:creator>malmoore</dc:creator>
      <dc:date>2012-03-14T14:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to collect perf counters of type average or per second?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90631#M18822</link>
      <description>&lt;P&gt;Actually I use splunk-wmi only to check WQL query. For the collection of perf counters I use Splunk Light Forwarder, that returns zero for perf counters of type average and per second.&lt;/P&gt;

&lt;P&gt;This is my config for SLF.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;wmi.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;[WMI:PhysicalDisk]&lt;/P&gt;

&lt;P&gt;disabled = 0&lt;/P&gt;

&lt;P&gt;interval = 360&lt;/P&gt;

&lt;P&gt;server = localhost&lt;/P&gt;

&lt;P&gt;wql = SELECT Name, PercentDiskTime, AvgDiskQueueLength FROM Win32_PerfFormattedData_PerfDisk_PhysicalDisk WHERE Name = '_Total'&lt;/P&gt;

&lt;P&gt;I want to once again draw your attention that the data is not properly collected only for perf counters of type &lt;STRONG&gt;average and per second&lt;/STRONG&gt;. For incremental perf counters everything is fine.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:31:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90631#M18822</guid>
      <dc:creator>donhuanmatus</dc:creator>
      <dc:date>2020-09-28T11:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to collect perf counters of type average or per second?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90632#M18823</link>
      <description>&lt;P&gt;I'd like to add some details. We worked toghether with donhuanmatus on this issue. The real problem is that we have sporadical values for the counters when we collect them by Light Weight Forwarder (LWF). More precisely speaking we have very few values from a bunch of counter of the types he mentioned collected every 6 minutes. And for example we have only 5 or 10 sporadical values for them during the day. We collect our own counters that are 'average value' and 'value per second'. The good example of counters of that types are 'Physical Disk\Avg. Disk Queue Length' and ' Physical Disk\Disk Read Bytes/sec'. We also have a number of simple incremental counters that are successfully collected, so the problem is with the counters of that specific types.&lt;/P&gt;

&lt;P&gt;When we started debugging the WQL used by LWF we faced that splunk-wmi returns zero all the time in spite non-zero values are shown in Performance Monitor. So we also tried to collect anything for Windows built-in counters like the ones mentioned above from 'Physical Disk' category and had no success.&lt;/P&gt;

&lt;P&gt;malmoore wrote that WBEMTEST also did't return values for counters 'Avg. Disk Queue Length' and ' Physical Disk\Disk Read Bytes/sec', which gets me confused. So let me rephrase the question. Could someone experienced provide an example of WQL that collects counters 'Physical Disk\Avg. Disk Queue Length' and ' Physical Disk\Disk Read Bytes/sec' correctly. Having such example we can dig deper and make our own counters work.&lt;/P&gt;

&lt;P&gt;Thanks, any help will be much appreciated! &lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2012 08:49:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90632#M18823</guid>
      <dc:creator>mikhail_mikheev</dc:creator>
      <dc:date>2012-03-15T08:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to collect perf counters of type average or per second?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90633#M18824</link>
      <description>&lt;P&gt;Can you tell me which version of Splunk you are using? Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2012 04:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90633#M18824</guid>
      <dc:creator>malmoore</dc:creator>
      <dc:date>2012-03-16T04:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to collect perf counters of type average or per second?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90634#M18825</link>
      <description>&lt;P&gt;So I just wanted to provide an update to this.&lt;/P&gt;

&lt;P&gt;After some internal discussion, I've decided to open a bug on this issue. While we are not convinced that Splunk is generating invalid data, we are investigating whether or not the data being returned by WMI is valid.&lt;/P&gt;

&lt;P&gt;We have, so far, concluded unequivocally that splunk-wmi does, in fact, return non-zero data for average- and per-second performance counters gathered against the local WMI namespace. The questions that remain are:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;How reliable or valid is this data?&lt;/LI&gt;
&lt;LI&gt;How is splunk-wmi presenting this data?&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Once our investigation is complete, I'll post an update here. In the meantime, there are ways to work around this possible issue:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Use a &lt;A href="http://docs.splunk.com/Splexicon:Universalforwarder"&gt;universal forwarder&lt;/A&gt; to collect data from your remote Windows machines, instead of a light forwarder.&lt;/LI&gt;
&lt;LI&gt;Use &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Real-timeWindowsperformancemonitoring"&gt;performance monitoring inputs&lt;/A&gt; to get your data, instead of WMI.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Cheers.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2012 06:36:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90634#M18825</guid>
      <dc:creator>malmoore</dc:creator>
      <dc:date>2012-03-16T06:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to collect perf counters of type average or per second?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90635#M18826</link>
      <description>&lt;P&gt;Finally, another update. Thanks for your patience.&lt;/P&gt;

&lt;P&gt;The 'anomaly' you're seeing with splunk-wmi returning 0 values is directly attributed to the fact that the WMI specification defines Win32_PerfFormattedData structures as unsigned integers. Performance Monitor allows for decimal values.&lt;/P&gt;

&lt;P&gt;What you're seeing, particularly with Average Disk Queue Length, is WMI rounding the value down to 0. If you compare WMI based data to Performance Monitor-based data, you'll see that the Perfmon data is also very close to 0 (but is not 0).&lt;/P&gt;

&lt;P&gt;It's always best to use Performance Monitoring inputs instead of WMI inputs to get the data you need. I've already provided links to the appropriate documentation. We'll update the documentation to include additional information on the discrepancies between WMI and Perfmon inputs.&lt;/P&gt;

&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2012 12:42:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90635#M18826</guid>
      <dc:creator>malmoore</dc:creator>
      <dc:date>2012-03-20T12:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to collect perf counters of type average or per second?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90636#M18827</link>
      <description>&lt;P&gt;Thanks a lot! We will dig into this direction. &lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2012 13:16:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90636#M18827</guid>
      <dc:creator>mikhail_mikheev</dc:creator>
      <dc:date>2012-03-20T13:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to collect perf counters of type average or per second?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90637#M18828</link>
      <description>&lt;P&gt;One question, please.&lt;/P&gt;

&lt;P&gt;When we use WIMI we could specify the instances of the perf. counter as follows:&lt;/P&gt;

&lt;P&gt;[WMI:RedisService_Private_Bytes]&lt;/P&gt;

&lt;P&gt;disabled = 0&lt;/P&gt;

&lt;P&gt;interval = 360&lt;/P&gt;

&lt;P&gt;server = localhost&lt;/P&gt;

&lt;P&gt;wql = SELECT Name, PrivateBytes FROM Win32_PerfFormattedData_PerfProc_Process WHERE &lt;STRONG&gt;LIKE 'redis-server%'&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Performance monitoring inputs allows you to do something like that, or need to explicitly specify the name?&lt;BR /&gt;
In the documentation I could not find something like that.&lt;/P&gt;

&lt;P&gt;Now we make the following way, but it's not very convenient:&lt;/P&gt;

&lt;P&gt;[SystemPerfmon:Process]&lt;/P&gt;

&lt;P&gt;interval = 360&lt;/P&gt;

&lt;P&gt;object = Process&lt;/P&gt;

&lt;P&gt;counters = Private Bytes&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;instances = redis-server0;redis-server1;redis-server2;redis-server3;redis-server4;redis-server5;redis-server6;redis-server7;redis-server8&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;disabled = 0&lt;/P&gt;

&lt;P&gt;index = sns&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:36:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-collect-perf-counters-of-type-average-or-per-second/m-p/90637#M18828</guid>
      <dc:creator>donhuanmatus</dc:creator>
      <dc:date>2020-09-28T11:36:12Z</dc:date>
    </item>
  </channel>
</rss>

