<?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: join and compare the values in 2 different field which values are same from different in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/join-and-compare-the-values-in-2-different-field-which-values/m-p/298335#M89962</link>
    <description>&lt;P&gt;I would do like this (gives list of common ContextId values between two data sources of yours)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=mapps sourcetype=iis  host=*) OR (index=gateways  source=http:ClientLoggingProd message.application="samrts") earliest=-1h@m | eval ContextId=coalesce('message.sourceSession',ContextId) | stats count by ContextId | table ContextId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 05 Oct 2017 18:33:48 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-10-05T18:33:48Z</dc:date>
    <item>
      <title>join and compare the values in 2 different field which values are same from different</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-and-compare-the-values-in-2-different-field-which-values/m-p/298334#M89961</link>
      <description>&lt;P&gt;in my search contcxtid and sourceSession has the same vales but indexing in to different places  how could i compare the 2 field values  and want to display the command filed values&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=mapps sourcetype=iis  host=* earliest=-1h@m|dedup ContextId |table ContextId |join type=inner ContextId [search index=gateways  source=http:ClientLoggingProd message.application="samrts" earliest=-1h@m | dedup "message.sourceSession" |rename message.sourceSession as sourceSession] |eval nodiff=if(match(sourceSession,ContextId),"ContextId",NULL) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Oct 2017 17:42:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-and-compare-the-values-in-2-different-field-which-values/m-p/298334#M89961</guid>
      <dc:creator>svemurilv</dc:creator>
      <dc:date>2017-10-05T17:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: join and compare the values in 2 different field which values are same from different</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-and-compare-the-values-in-2-different-field-which-values/m-p/298335#M89962</link>
      <description>&lt;P&gt;I would do like this (gives list of common ContextId values between two data sources of yours)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=mapps sourcetype=iis  host=*) OR (index=gateways  source=http:ClientLoggingProd message.application="samrts") earliest=-1h@m | eval ContextId=coalesce('message.sourceSession',ContextId) | stats count by ContextId | table ContextId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Oct 2017 18:33:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-and-compare-the-values-in-2-different-field-which-values/m-p/298335#M89962</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-10-05T18:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: join and compare the values in 2 different field which values are same from different</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-and-compare-the-values-in-2-different-field-which-values/m-p/298336#M89963</link>
      <description>&lt;P&gt;Assumptions:  you want the last record from each message.sourceSession from index=gateways, that has a ContextId in index mapps for the same time frame.&lt;/P&gt;

&lt;P&gt;It is important to note that you aren't using any information from the &lt;CODE&gt;mapps&lt;/CODE&gt; index other than the presence of a record, so getting the latest is not needed - if any record exists in index &lt;CODE&gt;mapps&lt;/CODE&gt; for a &lt;CODE&gt;ContextId&lt;/CODE&gt;, then you want the corresponding latest record from the other index.&lt;/P&gt;

&lt;P&gt;Try this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-1h@m
(index=mapps sourcetype=iis  host=* ) OR (index=gateways source=http:ClientLoggingProd message.application="samrts" )
| rename message.sourceSession as sourceSession
| fields index ContextId sourceSession (and whatever else you need) 
| eventstats max(eval(case(index="mapps",1))) as mappfound by ContextId
| where mappfound=1 and index="gateways"
| dedup sourceSession
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Oct 2017 20:18:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-and-compare-the-values-in-2-different-field-which-values/m-p/298336#M89963</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-05T20:18:45Z</dc:date>
    </item>
  </channel>
</rss>

