<?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: Dedup and 'OR' problem in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Dedup-and-OR-problem/m-p/526038#M148476</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=zt2 (first_search) OR (second_search)
|stats count(eval(searchmatch("first_search"))) as "XXX",
count(eval(searchmatch("secont_search"))) as "YYY" by USER_ID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How about this?&lt;/P&gt;</description>
    <pubDate>Thu, 22 Oct 2020 13:54:53 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-10-22T13:54:53Z</dc:date>
    <item>
      <title>Dedup and 'OR' problem</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-and-OR-problem/m-p/526032#M148473</link>
      <description>&lt;P&gt;Hi. I'm quite newbie in Splunk, but I'm trying to find solution to my problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=zt2 (first_search) OR (second_search)
|dedup USER_ID
|eval xxx=if(searchmatch("first_search"), 1, 0)
|eval yyy=if(searchmatch("secont_search"), 1, 0)
|stats count(eval(xxx=1)) as "XXX",
count(eval(yyy=1)) as "YYY"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to count unique USER_ID per each eval expression, but problem is sometimes this same USER_ID&amp;nbsp;appears in both searches (first_search and second_search), and dedup doesn't work&amp;nbsp;&lt;SPAN&gt;correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How do I make dedup affect xxx and yyy separately in eval?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 13:33:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-and-OR-problem/m-p/526032#M148473</guid>
      <dc:creator>Reijo86</dc:creator>
      <dc:date>2020-10-22T13:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dedup and 'OR' problem</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dedup-and-OR-problem/m-p/526038#M148476</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=zt2 (first_search) OR (second_search)
|stats count(eval(searchmatch("first_search"))) as "XXX",
count(eval(searchmatch("secont_search"))) as "YYY" by USER_ID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How about this?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 13:54:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dedup-and-OR-problem/m-p/526038#M148476</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-10-22T13:54:53Z</dc:date>
    </item>
  </channel>
</rss>

