<?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: How do I find common values in result of two queries on same source and field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-common-values-in-result-of-two-queries-on-same/m-p/586312#M204252</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=A sourcetype=B  "ERROR_A" OR "ERROR_B"
| rex field=_raw "loginid (?&amp;lt;login_id&amp;gt;\d+) ::" 
| eval Error=if(searchmatch("ERROR_A"), "ERROR_A" ,"ERROR_B" )
| stats dc(Error) as Errors by loginid | where Errors=2
| tableloginid&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 23 Feb 2022 20:43:01 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2022-02-23T20:43:01Z</dc:date>
    <item>
      <title>How do I find common values in result of two queries on same source and field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-common-values-in-result-of-two-queries-on-same/m-p/586285#M204238</link>
      <description>&lt;P&gt;I have two queries:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. index=A sourcetype=B&amp;nbsp; "ERROR_A" | rex field=_raw "loginid (?&amp;lt;login_id&amp;gt;\d+) ::" | deduploginid | tableloginid&lt;/P&gt;&lt;P&gt;o/p eg::&lt;/P&gt;&lt;P&gt;123&lt;/P&gt;&lt;P&gt;456&lt;/P&gt;&lt;P&gt;789&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. index=A sourcetype=B&amp;nbsp; "ERROR_B" | rex field=_raw "loginid (?&amp;lt;login_id&amp;gt;\d+) ::" | dedup loginid | table loginid&lt;/P&gt;&lt;P&gt;o/p eg::&lt;/P&gt;&lt;P&gt;878&lt;/P&gt;&lt;P&gt;123&lt;/P&gt;&lt;P&gt;456&lt;/P&gt;&lt;P&gt;Query 1 finds all the login ID which failed because of ERROR_A and Query 2 finds all the login ID which failed because of ERROR_B. I want to find all the loginId which failed because of both ERROR_A and ERROR_B.SO expected result from above is&lt;/P&gt;&lt;P&gt;123&lt;/P&gt;&lt;P&gt;456&lt;/P&gt;&lt;P&gt;How can I combine both these queries given the the loginid is a extract field from raw logs.?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 17:24:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-common-values-in-result-of-two-queries-on-same/m-p/586285#M204238</guid>
      <dc:creator>user9025</dc:creator>
      <dc:date>2022-02-23T17:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find common values in result of two queries on same source and field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-common-values-in-result-of-two-queries-on-same/m-p/586292#M204239</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=A sourcetype=B "ERROR_A" OR "ERROR_B" 
| rex "(?&amp;lt;errortype&amp;gt;ERROR_A|ERROR_B)"
| rex field=_raw "loginid (?&amp;lt;login_id&amp;gt;\d+) ::" 
| stats count by login_id errortype
| stats count by login_id
| where count = 2&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Feb 2022 18:00:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-common-values-in-result-of-two-queries-on-same/m-p/586292#M204239</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-02-23T18:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find common values in result of two queries on same source and field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-common-values-in-result-of-two-queries-on-same/m-p/586312#M204252</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=A sourcetype=B  "ERROR_A" OR "ERROR_B"
| rex field=_raw "loginid (?&amp;lt;login_id&amp;gt;\d+) ::" 
| eval Error=if(searchmatch("ERROR_A"), "ERROR_A" ,"ERROR_B" )
| stats dc(Error) as Errors by loginid | where Errors=2
| tableloginid&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Feb 2022 20:43:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-common-values-in-result-of-two-queries-on-same/m-p/586312#M204252</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2022-02-23T20:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find common values in result of two queries on same source and field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-common-values-in-result-of-two-queries-on-same/m-p/586357#M204267</link>
      <description>&lt;P&gt;I will try and update. May I know that in the expression :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Error=if(searchmatch("ERROR_A"), "ERROR_A" ,"ERROR_B" )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why have we put only ERROR_A in searchmatch clause ?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 05:59:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-common-values-in-result-of-two-queries-on-same/m-p/586357#M204267</guid>
      <dc:creator>user9025</dc:creator>
      <dc:date>2022-02-24T05:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find common values in result of two queries on same source and field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-common-values-in-result-of-two-queries-on-same/m-p/586358#M204268</link>
      <description>&lt;P&gt;Testing.Will update once i ran this.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 05:59:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-common-values-in-result-of-two-queries-on-same/m-p/586358#M204268</guid>
      <dc:creator>user9025</dc:creator>
      <dc:date>2022-02-24T05:59:21Z</dc:date>
    </item>
  </channel>
</rss>

