<?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 Comparing 2 searches using different sources? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-2-searches-using-different-sources/m-p/633830#M220141</link>
    <description>&lt;P&gt;I am trying to make 2 searches using different indexes and sources&lt;/P&gt;
&lt;P&gt;The first search is looking for all entries with "message sent" and the "Message Id". The second search is looking for the "Message Id" and "message sent".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I am trying to find the number of messages that were sent but not received by comparing the message ID, and list the message IDs that were not sent&lt;/P&gt;
&lt;P&gt;Example Attempt:&lt;/P&gt;
&lt;PRE&gt;(index = exampleindex1 source = examplesource1 ("message sent" AND "MessageId")&amp;nbsp; &lt;BR /&gt;OR&amp;nbsp;(index = exampleindex2 source = examplesource2 ("message received" AND "MessageId")&amp;nbsp; &lt;BR /&gt;| rex field=_raw "MessageId:(?&amp;lt;messageId&amp;gt;[\S]+)\s.*"&amp;nbsp;&lt;BR /&gt;| stats values(*) as * by messageId &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2023 19:48:20 GMT</pubDate>
    <dc:creator>ckutach</dc:creator>
    <dc:date>2023-03-09T19:48:20Z</dc:date>
    <item>
      <title>Comparing 2 searches using different sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-2-searches-using-different-sources/m-p/633830#M220141</link>
      <description>&lt;P&gt;I am trying to make 2 searches using different indexes and sources&lt;/P&gt;
&lt;P&gt;The first search is looking for all entries with "message sent" and the "Message Id". The second search is looking for the "Message Id" and "message sent".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I am trying to find the number of messages that were sent but not received by comparing the message ID, and list the message IDs that were not sent&lt;/P&gt;
&lt;P&gt;Example Attempt:&lt;/P&gt;
&lt;PRE&gt;(index = exampleindex1 source = examplesource1 ("message sent" AND "MessageId")&amp;nbsp; &lt;BR /&gt;OR&amp;nbsp;(index = exampleindex2 source = examplesource2 ("message received" AND "MessageId")&amp;nbsp; &lt;BR /&gt;| rex field=_raw "MessageId:(?&amp;lt;messageId&amp;gt;[\S]+)\s.*"&amp;nbsp;&lt;BR /&gt;| stats values(*) as * by messageId &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 19:48:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-2-searches-using-different-sources/m-p/633830#M220141</guid>
      <dc:creator>ckutach</dc:creator>
      <dc:date>2023-03-09T19:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing 2 searches using different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-2-searches-using-different-sources/m-p/633832#M220143</link>
      <description>&lt;P&gt;Something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index = exampleindex1 source = examplesource1 ("message sent" AND "MessageId") )
OR (index = exampleindex2 source = examplesource2 ("message received" AND "MessageId") )
| rex field=_raw "MessageId:(?&amp;lt;messageId&amp;gt;[\S]+)\s.*"
| rex "\bmessage\s+&amp;lt;?type&amp;gt;(sent|received)\b" ``` no need to specify field if _raw ```
| stats dc(messageId) as msgCount by type
| eval msgCount = if(type == "received", -msgCount, msgCount)
| stats sum(msgCount) as sent_not_received&lt;/LI-CODE&gt;&lt;P&gt;You missed a couple parenthesis.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 05:20:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-2-searches-using-different-sources/m-p/633832#M220143</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-03-09T05:20:23Z</dc:date>
    </item>
  </channel>
</rss>

