<?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: Linux and Windows CPU monitoring in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Linux-and-Windows-CPU-monitoring/m-p/31070#M1288</link>
    <description>&lt;P&gt;Ok,  If I understand your objective correctly you would like to display CPU usage as percentage regardless of if the system is Win or *Nix.  I am also assuming that you only want pctIdle where pctUser equals all.  My first step would be to normallize the data.  Since it looks like you have multivalued fields for you *Nix event I would uses mvindex to return single or subset.&lt;/P&gt;

&lt;P&gt;I assuem that this base search returns your events for both systems.&lt;BR /&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
host="CARDS_QA_*" (sourcetype=cpu OR source=WMI:CPUTime)&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
This section tries to turn pctIdle into a percent and adds it to the field PercentProcessorTime just like the pre-existing field in Win data.  I use mvindex to return the first value 0 in the multivalued field called pctIdle.  Then I perform the math.&lt;BR /&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
... |eval PercentProcessorTime=(100-mvindex(pctIdle,0))&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
Then I uses the field command to verify the values by host.  I should see values for both *Nix and Win systems  now in the PercentProcessorTime.  Fields command is a great way to table and verify your data.&lt;BR /&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
...|fields _time host, PercentProcessorTime&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
If everthing looks good I then peform a timechart command.&lt;/P&gt;

&lt;P&gt;Example search:&lt;BR /&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
host="CARDS_QA_*" (sourcetype=cpu OR source=WMI:CPUTime) |eval PercentProcessorTime=(100-mvindex(pctIdle,0))|fields _time host, PercentProcessorTime| timechart span=5m avg(PercentProcessorTime) as Percent_CPU_Load by host&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
You may need to play with a bit to get the intended results. Another option would be to sperate your seaches and use join. linux_cpu_seach | fields _time,y,z |join _time[search win_cpu_serch|fields _time,y,z] |timechart ...&lt;/P&gt;

&lt;P&gt;I hope this helps or gets you started.  Dont forget to accept or thumbs up answer. Cheers&lt;/P&gt;

&lt;P&gt;Additional reading:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/Search/Parsemultivaluefields"&gt;Parsemultivaluefields&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/CommonEvalFunctions"&gt;CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Nov 2012 01:18:45 GMT</pubDate>
    <dc:creator>bmacias84</dc:creator>
    <dc:date>2012-11-13T01:18:45Z</dc:date>
    <item>
      <title>Linux and Windows CPU monitoring</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Linux-and-Windows-CPU-monitoring/m-p/31066#M1284</link>
      <description>&lt;P&gt;is it possible to have a single dash board that gives the cpu usage for both windows and linux machines??&lt;BR /&gt;
I tried a query some thing like the on below but it dint work.&lt;/P&gt;

&lt;P&gt;host="CARDS_QA_*" sourcetype=cpu OR source=WMI:CPUTime eval CPULoad = PercentProcessorTime multikv fields pctIdle  | eval Percent_CPU_Load = 100 - pctIdle | timechart avg(Percent_CPU_Load) avg(CPULoad) by host &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:47:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Linux-and-Windows-CPU-monitoring/m-p/31066#M1284</guid>
      <dc:creator>karthikbalakris</dc:creator>
      <dc:date>2020-09-28T12:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Linux and Windows CPU monitoring</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Linux-and-Windows-CPU-monitoring/m-p/31067#M1285</link>
      <description>&lt;P&gt;@karthikbalak...,  I have some Ideas.  Would you mind posting a sample the _raw data for your both.  Also how would you like that data displayed or broken down?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2012 21:43:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Linux-and-Windows-CPU-monitoring/m-p/31067#M1285</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2012-11-12T21:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Linux and Windows CPU monitoring</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Linux-and-Windows-CPU-monitoring/m-p/31068#M1286</link>
      <description>&lt;P&gt;Raw Data for Linux:&lt;BR /&gt;
1   »  11/12/12&lt;BR /&gt;
4:46:07.000 PM&lt;BR /&gt;&lt;BR /&gt;
CPU    pctUser    pctNice  pctSystem  pctIowait    pctIdle&lt;BR /&gt;
PM         all       0.25       0.00       0.25      99.50&lt;BR /&gt;
PM           0       0.00       0.00       0.00     100.00&lt;BR /&gt;
PM           1       0.00       0.00       0.00     100.00&lt;BR /&gt;
PM           2       0.00       0.00       0.00     100.00&lt;BR /&gt;
PM           3       0.00       0.00       0.00     100.00&lt;BR /&gt;
host=CARDS_QA_WLI1   Options|  sourcetype=cpu   Options|  source=cpu   Options&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:47:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Linux-and-Windows-CPU-monitoring/m-p/31068#M1286</guid>
      <dc:creator>karthikbalakris</dc:creator>
      <dc:date>2020-09-28T12:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Linux and Windows CPU monitoring</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Linux-and-Windows-CPU-monitoring/m-p/31069#M1287</link>
      <description>&lt;P&gt;Raw Data for Windows:&lt;/P&gt;

&lt;P&gt;1   »  11/12/12&lt;BR /&gt;
4:46:20.890 PM&lt;BR /&gt;&lt;BR /&gt;
20121112164620.890625&lt;BR /&gt;
PercentProcessorTime=0&lt;BR /&gt;
PercentUserTime=0&lt;BR /&gt;
wmi_type=CPUTime&lt;BR /&gt;
host=HPSM_QA_APP   Options|  sourcetype=WMI:CPUTime   Options|  source=WMI:CPUTime   Options&lt;/P&gt;

&lt;P&gt;I am just looking for a normal line graph that has the cpu for both windows and linux servers. but i need it in only a single dashboard. &lt;/P&gt;

&lt;P&gt;Thanks for your time and help.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:47:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Linux-and-Windows-CPU-monitoring/m-p/31069#M1287</guid>
      <dc:creator>karthikbalakris</dc:creator>
      <dc:date>2020-09-28T12:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Linux and Windows CPU monitoring</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Linux-and-Windows-CPU-monitoring/m-p/31070#M1288</link>
      <description>&lt;P&gt;Ok,  If I understand your objective correctly you would like to display CPU usage as percentage regardless of if the system is Win or *Nix.  I am also assuming that you only want pctIdle where pctUser equals all.  My first step would be to normallize the data.  Since it looks like you have multivalued fields for you *Nix event I would uses mvindex to return single or subset.&lt;/P&gt;

&lt;P&gt;I assuem that this base search returns your events for both systems.&lt;BR /&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
host="CARDS_QA_*" (sourcetype=cpu OR source=WMI:CPUTime)&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
This section tries to turn pctIdle into a percent and adds it to the field PercentProcessorTime just like the pre-existing field in Win data.  I use mvindex to return the first value 0 in the multivalued field called pctIdle.  Then I perform the math.&lt;BR /&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
... |eval PercentProcessorTime=(100-mvindex(pctIdle,0))&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
Then I uses the field command to verify the values by host.  I should see values for both *Nix and Win systems  now in the PercentProcessorTime.  Fields command is a great way to table and verify your data.&lt;BR /&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
...|fields _time host, PercentProcessorTime&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
If everthing looks good I then peform a timechart command.&lt;/P&gt;

&lt;P&gt;Example search:&lt;BR /&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
host="CARDS_QA_*" (sourcetype=cpu OR source=WMI:CPUTime) |eval PercentProcessorTime=(100-mvindex(pctIdle,0))|fields _time host, PercentProcessorTime| timechart span=5m avg(PercentProcessorTime) as Percent_CPU_Load by host&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
You may need to play with a bit to get the intended results. Another option would be to sperate your seaches and use join. linux_cpu_seach | fields _time,y,z |join _time[search win_cpu_serch|fields _time,y,z] |timechart ...&lt;/P&gt;

&lt;P&gt;I hope this helps or gets you started.  Dont forget to accept or thumbs up answer. Cheers&lt;/P&gt;

&lt;P&gt;Additional reading:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/Search/Parsemultivaluefields"&gt;Parsemultivaluefields&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/CommonEvalFunctions"&gt;CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2012 01:18:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Linux-and-Windows-CPU-monitoring/m-p/31070#M1288</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2012-11-13T01:18:45Z</dc:date>
    </item>
  </channel>
</rss>

