<?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: Alert when row count for two searches are not equal in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Alert-when-row-count-for-two-searches-are-not-equal/m-p/533381#M150703</link>
    <description>&lt;P&gt;Thank you, Rich. Wasn't exactly my solution, but your post gave me my solution. What I ended up doing was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats values(*) as *
| eval Difference = itemsReceived - itemsProcessed
| appendcols [stats values(Difference) as Difference by transactionID]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wouldn't have come to that realization had it not been for your reply. Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2020 00:45:25 GMT</pubDate>
    <dc:creator>seomaniv</dc:creator>
    <dc:date>2020-12-17T00:45:25Z</dc:date>
    <item>
      <title>Alert when row count for two searches are not equal</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alert-when-row-count-for-two-searches-are-not-equal/m-p/532563#M150445</link>
      <description>&lt;P&gt;I have two events: items received, and items acted on. I want to set an alert when the count by transactionID is not equal for the two searches. I have the search set up like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myIndex source=mySource 
| search criteriaForItemsReceived
| stats count as itemsReceived by transactionID
| append
    [ search index-myIndex source=mySource
    | search criteriaForItemsProcessed
    | stats count as itemsProcessed by transactionID ]
| stats values(*) as * by transactionID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ok, it's a little more complicated, but this is the important part. So then need to compare itemsReceived to itemsProcessed to determine if there should be an alert. I have tried&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... stats values(eval(itemsReceived-itemsProcessed)) as Difference ...
| search Difference != 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as well as doing the eval before the stats, but everything I try ends up with null values for the eval, even though the table is properly populated with the values for itemsReceived and itemsProcessed (I have also tried convert num(itemsReceived) and tonumber(itemsReceived,10) in the event Splunk was not recognizing these fields as numbers, but each time, the fields are null).&lt;/P&gt;&lt;P&gt;What am I doing wrong here?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 00:23:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alert-when-row-count-for-two-searches-are-not-equal/m-p/532563#M150445</guid>
      <dc:creator>seomaniv</dc:creator>
      <dc:date>2020-12-10T00:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Alert when row count for two searches are not equal</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alert-when-row-count-for-two-searches-are-not-equal/m-p/532567#M150448</link>
      <description>&lt;P&gt;The problem may be with the &lt;FONT face="courier new,courier"&gt;values(*)&lt;/FONT&gt; clause returning multi-field values, which most other functions can't handle.&amp;nbsp; Try this alternative:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myIndex source=mySource 
| search criteriaForItemsReceived
| eval state="Rcvd"
| append
    [ search index-myIndex source=mySource
    | search criteriaForItemsProcessed
    | eval state="Proc" ]
| stats count(eval(state="Rcvd")) as itemsReceived, count(eval(state="Proc")) as itemsProcessed by transactionID
| eval Difference = itemsReceived - itemsProcessed &lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Dec 2020 01:35:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alert-when-row-count-for-two-searches-are-not-equal/m-p/532567#M150448</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-12-10T01:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Alert when row count for two searches are not equal</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alert-when-row-count-for-two-searches-are-not-equal/m-p/533381#M150703</link>
      <description>&lt;P&gt;Thank you, Rich. Wasn't exactly my solution, but your post gave me my solution. What I ended up doing was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats values(*) as *
| eval Difference = itemsReceived - itemsProcessed
| appendcols [stats values(Difference) as Difference by transactionID]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wouldn't have come to that realization had it not been for your reply. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 00:45:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alert-when-row-count-for-two-searches-are-not-equal/m-p/533381#M150703</guid>
      <dc:creator>seomaniv</dc:creator>
      <dc:date>2020-12-17T00:45:25Z</dc:date>
    </item>
  </channel>
</rss>

