<?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: Search to shows results for the past 30 days? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-to-shows-results-for-the-past-30-days/m-p/301957#M90915</link>
    <description>&lt;P&gt;Give this a try (may not be the faster search you will see)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbinspect index=webserver_index span=1h | untable _time bucket count | dedup bucket | rex field=bucket "(?&amp;lt;state&amp;gt;\w+)-(?&amp;lt;id&amp;gt;\d+)" | sort 0 -_time | dedup id | join id [| dbinspect index=webserver_index 
| fields state,id,rawSize,sizeOnDiskMB,index,splunk_server] | bucket span=1h _time | stats sum(rawSize) AS rawTotal, sum(sizeOnDiskMB) AS diskTotalinMB by _time index splunk_server | eval diskTotalinGB=round(diskTotalinMB/1024,2)
| eval rawTotalinGB=round(rawTotal/(1024*1024*1024),2) | fields - rawTotal
| eval compression=tostring(100-round(diskTotalinGB / rawTotalinGB * 100, 2)) + "%"
| table _time index, splunk_server, rawTotalinGB, diskTotalinGB, compression | addcoltotals rawTotalinGB diskTotalinGB labelfield=splunk_server label="Total Usage(GB)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 25 Aug 2017 19:55:54 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-08-25T19:55:54Z</dc:date>
    <item>
      <title>Search to shows results for the past 30 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-shows-results-for-the-past-30-days/m-p/301956#M90914</link>
      <description>&lt;P&gt;Can I please get help to modify the below query to display results of each day for last 30 days which will show the rawtotal diskTotal compression &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbinspect index=webserver_index
| fields state,id,rawSize,sizeOnDiskMB,index,splunk_server
| stats sum(rawSize) AS rawTotal, sum(sizeOnDiskMB) AS diskTotalinMB by index splunk_server | eval diskTotalinGB=round(diskTotalinMB/1024,2)
| eval rawTotalinGB=round(rawTotal/(1024*1024*1024),2) | fields - rawTotal
| eval compression=tostring(100-round(diskTotalinGB / rawTotalinGB * 100, 2)) + "%"
| table index, splunk_server, rawTotalinGB, diskTotalinGB, compression | addcoltotals rawTotalinGB diskTotalinGB labelfield=splunk_server label="Total Usage(GB)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Aug 2017 19:09:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-shows-results-for-the-past-30-days/m-p/301956#M90914</guid>
      <dc:creator>kteng2024</dc:creator>
      <dc:date>2017-08-25T19:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Search to shows results for the past 30 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-shows-results-for-the-past-30-days/m-p/301957#M90915</link>
      <description>&lt;P&gt;Give this a try (may not be the faster search you will see)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbinspect index=webserver_index span=1h | untable _time bucket count | dedup bucket | rex field=bucket "(?&amp;lt;state&amp;gt;\w+)-(?&amp;lt;id&amp;gt;\d+)" | sort 0 -_time | dedup id | join id [| dbinspect index=webserver_index 
| fields state,id,rawSize,sizeOnDiskMB,index,splunk_server] | bucket span=1h _time | stats sum(rawSize) AS rawTotal, sum(sizeOnDiskMB) AS diskTotalinMB by _time index splunk_server | eval diskTotalinGB=round(diskTotalinMB/1024,2)
| eval rawTotalinGB=round(rawTotal/(1024*1024*1024),2) | fields - rawTotal
| eval compression=tostring(100-round(diskTotalinGB / rawTotalinGB * 100, 2)) + "%"
| table _time index, splunk_server, rawTotalinGB, diskTotalinGB, compression | addcoltotals rawTotalinGB diskTotalinGB labelfield=splunk_server label="Total Usage(GB)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Aug 2017 19:55:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-shows-results-for-the-past-30-days/m-p/301957#M90915</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-25T19:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Search to shows results for the past 30 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-shows-results-for-the-past-30-days/m-p/301958#M90916</link>
      <description>&lt;P&gt;@somesoni2 - &lt;/P&gt;

&lt;P&gt;This is ugly...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;tostring(100-round(diskTotalinGB / rawTotalinGB * 100, 2)) + "%"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is not....&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;tostring(100-round(100*diskTotalinGB / rawTotalinGB, 2)) + "%"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Aug 2017 22:35:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-shows-results-for-the-past-30-days/m-p/301958#M90916</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-25T22:35:09Z</dc:date>
    </item>
  </channel>
</rss>

