<?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: Multiple statistics for multiple linux servers, How do I write the query? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multiple-statistics-for-multiple-linux-servers-How-do-I-write/m-p/463892#M130763</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_nix_xxxx sourcetype=df host=abdhw003 OR host=n OR host=n OR host=n or host=n MountedOn="/doc"
| eval TotalGBytes= TotalMBytes/1024 | eval UsedGBytes=UsedMbytes/1024 |eval used_pct=100(UsedGBytes/TotalGBytes) 
| stats max(TotalGBytes) as "MaxSize(GB) max(UsedGBytes) as "UsedSize(GB) as "percentUsed" by host, MountedOn 
| search PercentUsed&amp;gt;05| Sort PercentUsed
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 03 Apr 2020 13:46:17 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-04-03T13:46:17Z</dc:date>
    <item>
      <title>Multiple statistics for multiple linux servers, How do I write the query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-statistics-for-multiple-linux-servers-How-do-I-write/m-p/463891#M130762</link>
      <description>&lt;P&gt;I tried:&lt;BR /&gt;
index=_nix_xxxx sourcetype=df host=abdhw003 MountedOn="/doc" |eval source="/doc*" and that seems to show the data of the /doc folder&lt;/P&gt;

&lt;P&gt;Now I have multiple servers and I need stats on all the servers seperately whichever server has &amp;gt;5% used. Please see example below. But when i run the below command then All the servers are adding up ad its showing me a 1 liner with all server info merged. I think I messed up in the stats algorithm. Please help.&lt;/P&gt;

&lt;P&gt;index=_nix_xxxx sourcetype=df host=abdhw003 OR host=n OR host=n OR host=n or host=n MountedOn="/doc"| eval TotalGBytes= TotalMBytes/1024 | eval UsedGBytes=UsedMbytes/1024 |eval used_pct=100(UsedGBytes/TotalGBytes) | stats max(TotalGBytes) as "MaxSize(GB) max(UsedGBytes) as "UsedSize(GB) as "percentUsed" by MountedOn | search PercentUsed&amp;gt;05| Sort PercentUsed&lt;/P&gt;

&lt;P&gt;Now the stats that I am getting is getting totalled(All 5 servers adding each other and showing me a max value) I think as the stats query has max value, How do I show stats of each server at a time? Any Ideas?&lt;/P&gt;

&lt;P&gt;Thanks for the help. I appreciate it&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:49:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-statistics-for-multiple-linux-servers-How-do-I-write/m-p/463891#M130762</guid>
      <dc:creator>mike000</dc:creator>
      <dc:date>2020-09-30T04:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple statistics for multiple linux servers, How do I write the query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-statistics-for-multiple-linux-servers-How-do-I-write/m-p/463892#M130763</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_nix_xxxx sourcetype=df host=abdhw003 OR host=n OR host=n OR host=n or host=n MountedOn="/doc"
| eval TotalGBytes= TotalMBytes/1024 | eval UsedGBytes=UsedMbytes/1024 |eval used_pct=100(UsedGBytes/TotalGBytes) 
| stats max(TotalGBytes) as "MaxSize(GB) max(UsedGBytes) as "UsedSize(GB) as "percentUsed" by host, MountedOn 
| search PercentUsed&amp;gt;05| Sort PercentUsed
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Apr 2020 13:46:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-statistics-for-multiple-linux-servers-How-do-I-write/m-p/463892#M130763</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-04-03T13:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple statistics for multiple linux servers, How do I write the query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-statistics-for-multiple-linux-servers-How-do-I-write/m-p/463893#M130764</link>
      <description>&lt;P&gt;Thank you soo much, that worked like a charm. Much appreciated Rich, you rock!!!!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 14:01:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-statistics-for-multiple-linux-servers-How-do-I-write/m-p/463893#M130764</guid>
      <dc:creator>mike000</dc:creator>
      <dc:date>2020-04-03T14:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple statistics for multiple linux servers, How do I write the query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-statistics-for-multiple-linux-servers-How-do-I-write/m-p/463894#M130765</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_nix_xxxx" AND sourcetype="df" AND (host="abdhw003" OR host="x" OR host="y" OR host="z" or host="etc") AND MountedOn="/doc"
| stats max(TotalMBytes) AS max_TotalMBytes max(UsedMBytes) AS max_UsedMBytes avg(PercentUsedSpace) AS PercentUsed BY MountedOn 
| search PercentUsed&amp;gt;05 
| eval TotalGBytes = max_TotalMBytes / 1024
| eval UsedGBytes = max_UsedMBytes / 1024
| eval used_pct = 100 * (max_UsedMBytes / max_TotalMBytes)
| fields - TotalGBytes UsedGBytes
| sort 0 PercentUsed
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As a bonus, try this search, use the &lt;CODE&gt;Linechart&lt;/CODE&gt; visualization, turn on &lt;CODE&gt;Trellis&lt;/CODE&gt; feature and select &lt;CODE&gt;host&lt;/CODE&gt; for &lt;CODE&gt;split by&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="os" AND sourcetype="df" 
| eval FS_{Filesystem}=PercentUsedSpace
| timechart limit=0 [search index="os" AND sourcetype="df" earliest=-4h latest=now
| stats count BY Filesystem
| rename Filesystem AS max
| eval max = "FS_" . max
| eval zAS = max
| table max zAS
| format "" "" ")" "" "" ""
| rex field=search mode=sed "s/=\"/(/g s/\" \) zAS\(FS_/) AS /g s/\"\s+max/ max/g s/\"\s+$//"] BY host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Apr 2020 17:00:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-statistics-for-multiple-linux-servers-How-do-I-write/m-p/463894#M130765</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-04-03T17:00:52Z</dc:date>
    </item>
  </channel>
</rss>

