<?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: Eval Usage data to percentage as 1d span base, and table today, 1month ago, 3months ago, 6months ago in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-Usage-data-to-percentage-as-1d-span-base-and-table-today/m-p/543509#M153947</link>
    <description>&lt;P&gt;Assuming your events are already daily, and it is not clear what your fields are actually called since you use a mixture of names, try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;my base search
| eval usage = round('storage.used' / 'storage.total' * 100, 2)
| bin _time span=1d
| where _time IN (relative_time(now(),"@d"), relative_time(now(),"-1mon@d"), relative_time(now(),"-3mon@d"), relative_time(now(),"-6mon@d")) 
| eval _time=case(_time=relative_time(now(),"@d"),"Today", _time=relative_time(now(),"-1mon@d"), "1mon", _time=relative_time(now(),"-3mon@d"), "3mon", _time=relative_time(now(),"-6mon@d"), "6mon")
| chart limit=0 values(usage) as usage values('storage.used') as used values('storage.total') as total by name _time 
| transpose 0
| where match(column,"(name|usage:|used: Today|total: Today)")
| rex field=column mode=sed "s/used:.*/used/g s/total:.*/total/g"
| transpose 0 header_field=column
| fields - column&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Mar 2021 09:32:43 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-03-12T09:32:43Z</dc:date>
    <item>
      <title>Eval Usage data to percentage as 1d span base, and table today, 1month ago, 3months ago, 6months ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Usage-data-to-percentage-as-1d-span-base-and-table-today/m-p/543468#M153935</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to make time based table to check trend right away.&lt;/P&gt;&lt;P&gt;The data is currently accumulated on daily basis, which contains storage total GB, used GB per storage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I successfully made timechart that I can check trend of usage(used/&amp;nbsp; total * 100) data.&lt;/P&gt;&lt;P&gt;I made timechart viz with below command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;my base search
| eval usage = round('storage.used' / 'storage.total' * 100, 2)
| timechart span=1d limit=0 values(usage) by name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to make table that could show me usage data of today, 1month ago, 3months ago, 6months ago by storage. Like below. (Usage data must be calculated by used / total * 100 of the specific date.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;storage&amp;nbsp; &amp;nbsp;used&amp;nbsp; &amp;nbsp;total&amp;nbsp; &amp;nbsp;usage(today)&amp;nbsp; &amp;nbsp; usage(1mon)&amp;nbsp; &amp;nbsp;usage(3mon)&amp;nbsp; &amp;nbsp; usage(6mon)&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&amp;nbsp; &amp;nbsp; &amp;nbsp; 100&amp;nbsp; &amp;nbsp; &amp;nbsp;30&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 27&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 23&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to make table such way?? Thank you.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 01:53:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Usage-data-to-percentage-as-1d-span-base-and-table-today/m-p/543468#M153935</guid>
      <dc:creator>splunkkid</dc:creator>
      <dc:date>2021-03-12T01:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Eval Usage data to percentage as 1d span base, and table today, 1month ago, 3months ago, 6months ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Usage-data-to-percentage-as-1d-span-base-and-table-today/m-p/543509#M153947</link>
      <description>&lt;P&gt;Assuming your events are already daily, and it is not clear what your fields are actually called since you use a mixture of names, try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;my base search
| eval usage = round('storage.used' / 'storage.total' * 100, 2)
| bin _time span=1d
| where _time IN (relative_time(now(),"@d"), relative_time(now(),"-1mon@d"), relative_time(now(),"-3mon@d"), relative_time(now(),"-6mon@d")) 
| eval _time=case(_time=relative_time(now(),"@d"),"Today", _time=relative_time(now(),"-1mon@d"), "1mon", _time=relative_time(now(),"-3mon@d"), "3mon", _time=relative_time(now(),"-6mon@d"), "6mon")
| chart limit=0 values(usage) as usage values('storage.used') as used values('storage.total') as total by name _time 
| transpose 0
| where match(column,"(name|usage:|used: Today|total: Today)")
| rex field=column mode=sed "s/used:.*/used/g s/total:.*/total/g"
| transpose 0 header_field=column
| fields - column&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 09:32:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Usage-data-to-percentage-as-1d-span-base-and-table-today/m-p/543509#M153947</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-12T09:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Eval Usage data to percentage as 1d span base, and table today, 1month ago, 3months ago, 6months ago</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Usage-data-to-percentage-as-1d-span-base-and-table-today/m-p/543612#M153985</link>
      <description>&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;Since I'm in busy for other schedule, I will check this soon and come back to whether accept as solution&lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 01:43:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Usage-data-to-percentage-as-1d-span-base-and-table-today/m-p/543612#M153985</guid>
      <dc:creator>splunkkid</dc:creator>
      <dc:date>2021-03-13T01:43:41Z</dc:date>
    </item>
  </channel>
</rss>

