<?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 chart count for comparison in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/chart-count-for-comparison/m-p/675269#M231076</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have the below SPL and I am not able to get the expected results. Please could you help?&lt;/P&gt;&lt;P&gt;if i use stats count by - then i'm not getting the expected result as below.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SPL:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;basesearch earliest=@d latest=now&lt;BR /&gt;| append&lt;BR /&gt;[ search earliest=-1d@d latest=-1d]&lt;BR /&gt;| eval Consumer = case(match(File_Name,"^ABC"), "Down", match(File_Name,"^csd"),"UP", match(File_Name,"^CSD"),"UP",1==1,"Others")&lt;BR /&gt;| eval Day=if(_time&amp;lt;relative_time(now(),"@d"),"Yesterday","Today")&lt;BR /&gt;| eval percentage_variance=abs(round(((Yesterday-Today)/Yesterday)*100,2))&lt;BR /&gt;| table Name Consumer Today Yesterday percentage_variance&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expected Result:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="20%"&gt;Name&lt;/TD&gt;&lt;TD width="20%"&gt;Consumer&lt;/TD&gt;&lt;TD width="20%"&gt;Today&lt;/TD&gt;&lt;TD width="20%"&gt;Yesterday&lt;/TD&gt;&lt;TD width="20%"&gt;percentage_variance&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%"&gt;TEN&lt;/TD&gt;&lt;TD width="20%"&gt;UP&lt;/TD&gt;&lt;TD width="20%"&gt;10&lt;/TD&gt;&lt;TD width="20%"&gt;10&lt;/TD&gt;&lt;TD width="20%"&gt;0.0%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Wed, 24 Jan 2024 13:17:13 GMT</pubDate>
    <dc:creator>selvam_sekar</dc:creator>
    <dc:date>2024-01-24T13:17:13Z</dc:date>
    <item>
      <title>chart count for comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-count-for-comparison/m-p/675269#M231076</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have the below SPL and I am not able to get the expected results. Please could you help?&lt;/P&gt;&lt;P&gt;if i use stats count by - then i'm not getting the expected result as below.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SPL:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;basesearch earliest=@d latest=now&lt;BR /&gt;| append&lt;BR /&gt;[ search earliest=-1d@d latest=-1d]&lt;BR /&gt;| eval Consumer = case(match(File_Name,"^ABC"), "Down", match(File_Name,"^csd"),"UP", match(File_Name,"^CSD"),"UP",1==1,"Others")&lt;BR /&gt;| eval Day=if(_time&amp;lt;relative_time(now(),"@d"),"Yesterday","Today")&lt;BR /&gt;| eval percentage_variance=abs(round(((Yesterday-Today)/Yesterday)*100,2))&lt;BR /&gt;| table Name Consumer Today Yesterday percentage_variance&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expected Result:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="20%"&gt;Name&lt;/TD&gt;&lt;TD width="20%"&gt;Consumer&lt;/TD&gt;&lt;TD width="20%"&gt;Today&lt;/TD&gt;&lt;TD width="20%"&gt;Yesterday&lt;/TD&gt;&lt;TD width="20%"&gt;percentage_variance&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="20%"&gt;TEN&lt;/TD&gt;&lt;TD width="20%"&gt;UP&lt;/TD&gt;&lt;TD width="20%"&gt;10&lt;/TD&gt;&lt;TD width="20%"&gt;10&lt;/TD&gt;&lt;TD width="20%"&gt;0.0%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 24 Jan 2024 13:17:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-count-for-comparison/m-p/675269#M231076</guid>
      <dc:creator>selvam_sekar</dc:creator>
      <dc:date>2024-01-24T13:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: chart count for comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-count-for-comparison/m-p/675272#M231077</link>
      <description>&lt;P&gt;Assuming these are counts, you need to get values for Today and Yesterday into the same event in the pipeline. Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;basesearch earliest=@d latest=now
| append
[ search earliest=-1d@d latest=-1d]
| eval Consumer = case(match(File_Name,"^ABC"), "Down", match(File_Name,"^csd"),"UP", match(File_Name,"^CSD"),"UP",1==1,"Others")
| eval Day=if(_time&amp;lt;relative_time(now(),"@d"),"Yesterday","Today")
| stats count by Name Consumer Day
| eval {Day}=count
| fields - Day
| stats values(Today) as Today values(Yesterday) as Yesterday by Name Consumer
| eval percentage_variance=abs(round(((Yesterday-Today)/Yesterday)*100,2))
| table Name Consumer Today Yesterday percentage_variance&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Jan 2024 13:50:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-count-for-comparison/m-p/675272#M231077</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-01-24T13:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: chart count for comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-count-for-comparison/m-p/675277#M231078</link>
      <description>&lt;P&gt;Many Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;. In this SPL Logic how do we ignore the weekend dataand bring only the last working day count for yesterday ? is it possible ?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 14:27:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-count-for-comparison/m-p/675277#M231078</guid>
      <dc:creator>selvam_sekar</dc:creator>
      <dc:date>2024-01-24T14:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: chart count for comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-count-for-comparison/m-p/675296#M231079</link>
      <description>&lt;P&gt;Change this line so that it takes into account what the previous day is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[ search earliest=-1d@d latest=-1d]&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Jan 2024 18:05:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-count-for-comparison/m-p/675296#M231079</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-01-24T18:05:43Z</dc:date>
    </item>
  </channel>
</rss>

