<?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 Summary Index - How to count using eval on a specific field equals to true in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Summary-Index-How-to-count-using-eval-on-a-specific-field-equals/m-p/580109#M11061</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I am stuck with a query that is not working.&lt;/P&gt;&lt;P&gt;I have set up a summary index that collects data every 1 hour and every 15min.&lt;/P&gt;&lt;P&gt;I have a field 'isCostChanged' which I want to count basis 'Yes' and 'No' in Summary Index.&lt;BR /&gt;&lt;BR /&gt;Using this query :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;index=summary-my-sumdata splunk_server_group=default reporttype=costchangecount reporttime=fifteenmin isCostChanged=*&lt;/P&gt;&lt;P&gt;| stats sum(count) as Total, sum(eval(isCostChanged="true")) as CostChanged, sum(eval(isCostChanged="false")) as NoCostChanged by CountryCode&lt;BR /&gt;| eval CostChangeRatio=round((CostChanged/Total)*100,2)&lt;BR /&gt;| eval NoCostChangeRatio=round((NoCostChanged/Total)*100,2)&lt;BR /&gt;| fields CountryCode, NoCostChanged, CostChanged, CostChangeRatio&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What its doing - Total count is correct but the count for isCostChanged=true and =false is not correct, the count is less&lt;BR /&gt;&lt;BR /&gt;if I do this below to verify the data, the count is correct&lt;BR /&gt;&lt;BR /&gt;| stats sum(count) as Total by isCostChanged&lt;BR /&gt;&lt;BR /&gt;Can you help how to achieve this&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nishant&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jan 2022 11:27:21 GMT</pubDate>
    <dc:creator>beriwalnishant</dc:creator>
    <dc:date>2022-01-06T11:27:21Z</dc:date>
    <item>
      <title>Summary Index - How to count using eval on a specific field equals to true</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Summary-Index-How-to-count-using-eval-on-a-specific-field-equals/m-p/580109#M11061</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I am stuck with a query that is not working.&lt;/P&gt;&lt;P&gt;I have set up a summary index that collects data every 1 hour and every 15min.&lt;/P&gt;&lt;P&gt;I have a field 'isCostChanged' which I want to count basis 'Yes' and 'No' in Summary Index.&lt;BR /&gt;&lt;BR /&gt;Using this query :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;index=summary-my-sumdata splunk_server_group=default reporttype=costchangecount reporttime=fifteenmin isCostChanged=*&lt;/P&gt;&lt;P&gt;| stats sum(count) as Total, sum(eval(isCostChanged="true")) as CostChanged, sum(eval(isCostChanged="false")) as NoCostChanged by CountryCode&lt;BR /&gt;| eval CostChangeRatio=round((CostChanged/Total)*100,2)&lt;BR /&gt;| eval NoCostChangeRatio=round((NoCostChanged/Total)*100,2)&lt;BR /&gt;| fields CountryCode, NoCostChanged, CostChanged, CostChangeRatio&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What its doing - Total count is correct but the count for isCostChanged=true and =false is not correct, the count is less&lt;BR /&gt;&lt;BR /&gt;if I do this below to verify the data, the count is correct&lt;BR /&gt;&lt;BR /&gt;| stats sum(count) as Total by isCostChanged&lt;BR /&gt;&lt;BR /&gt;Can you help how to achieve this&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nishant&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 11:27:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Summary-Index-How-to-count-using-eval-on-a-specific-field-equals/m-p/580109#M11061</guid>
      <dc:creator>beriwalnishant</dc:creator>
      <dc:date>2022-01-06T11:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Summary Index - How to count using eval on a specific field equals to true</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Summary-Index-How-to-count-using-eval-on-a-specific-field-equals/m-p/580115#M11062</link>
      <description>&lt;P&gt;Summing count as total is not the same as counting change and no change events&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=summary-my-sumdata splunk_server_group=default reporttype=costchangecount reporttime=fifteenmin isCostChanged=*

| eval changeCost=if(isCostChanged="true",count,0)
| eval noChangeCost=if(isCostChanged="false",count,0)
| stats sum(count) as Total, sum(changeCost) as CostChanged, sum(noChangeCost) as NoCostChanged by CountryCode
| eval CostChangeRatio=round((CostChanged/Total)*100,2)
| eval NoCostChangeRatio=round((NoCostChanged/Total)*100,2)
| fields CountryCode, NoCostChanged, CostChanged, CostChangeRatio&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 06 Jan 2022 12:33:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Summary-Index-How-to-count-using-eval-on-a-specific-field-equals/m-p/580115#M11062</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-01-06T12:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Summary Index - How to count using eval on a specific field equals to true</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Summary-Index-How-to-count-using-eval-on-a-specific-field-equals/m-p/580119#M11063</link>
      <description>&lt;P&gt;Incredibly brilliant sir&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;That was awesome, it's so sad that on SI the simple sum(eval) doesn't work but no issues with your work around rocks.&lt;BR /&gt;&lt;BR /&gt;I checked and **bleep**, the count is bang on.&lt;BR /&gt;&lt;BR /&gt;The solution will make my queries lengthy but no worries as its a simple workaround&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot again&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 12:52:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Summary-Index-How-to-count-using-eval-on-a-specific-field-equals/m-p/580119#M11063</guid>
      <dc:creator>beriwalnishant</dc:creator>
      <dc:date>2022-01-06T12:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Summary Index - How to count using eval on a specific field equals to true</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Summary-Index-How-to-count-using-eval-on-a-specific-field-equals/m-p/580121#M11064</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Though I dont doubt this query and sure is the most simple one but i just want to see the different ways people have before I click on 'Accept as solution'&lt;BR /&gt;&lt;BR /&gt;Which I will do just want to see what others come up with - good to have more than one solution&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 12:53:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Summary-Index-How-to-count-using-eval-on-a-specific-field-equals/m-p/580121#M11064</guid>
      <dc:creator>beriwalnishant</dc:creator>
      <dc:date>2022-01-06T12:53:56Z</dc:date>
    </item>
  </channel>
</rss>

