<?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 to write a search to correlate data from multiple indexes? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130519#M35582</link>
    <description>&lt;P&gt;hmm, exactly as already posted and described below ....&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | eval correlation_field=case(isnotnull(IP), IP, isnotnull(IPaddr), IPaddr, 1=1, "unknown")
 | stats values(*) AS * by correlation_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Sat, 11 Aug 2018 20:59:04 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2018-08-11T20:59:04Z</dc:date>
    <item>
      <title>How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130505#M35568</link>
      <description>&lt;P&gt;Hello All,&lt;BR /&gt;
I am very new to Splunk.&lt;BR /&gt;
Can someone help me with this use case please:&lt;/P&gt;

&lt;P&gt;I have to create a search which should take an IP coming from a data source A and take that IP go to a file grab some info against that IP (like host name/location) sitting in index B. So being newbie I think I can do a search for IP&lt;BR /&gt;
index=A IP=xxx.xxx.xx.xxx &lt;BR /&gt;
what should be the second part of the search?&lt;BR /&gt;
Any help is appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 19:14:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130505#M35568</guid>
      <dc:creator>sunitachan</dc:creator>
      <dc:date>2015-02-04T19:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130506#M35569</link>
      <description>&lt;P&gt;Hi sunitachan,&lt;/P&gt;

&lt;P&gt;This is maybe difficult to understand at first, but take a look at this answer &lt;A href="http://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;http://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html&lt;/A&gt; to get an idea hoe this can be done.&lt;/P&gt;

&lt;P&gt;Happy splunking ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 19:30:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130506#M35569</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-02-04T19:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130507#M35570</link>
      <description>&lt;P&gt;Thank you MuS, I will read thru this and let you know if it works. &lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 21:56:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130507#M35570</guid>
      <dc:creator>sunitachan</dc:creator>
      <dc:date>2015-02-04T21:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130508#M35571</link>
      <description>&lt;P&gt;Alternatively to @MuS's approach of joining data, for using info from one search to find things in another search you can use this pattern:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=B [search index=A identifying things in index A | dedup IP | fields IP] | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That'll search index A for events containing your &lt;CODE&gt;IP&lt;/CODE&gt; value and then use the values returned to search index B.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2015 23:47:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130508#M35571</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-02-04T23:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130509#M35572</link>
      <description>&lt;P&gt;index A&lt;BR /&gt;
ip=1.1.1.1 myfield=x&lt;BR /&gt;
ip=1.1.1.2 myfield=y&lt;/P&gt;

&lt;P&gt;index B&lt;BR /&gt;
ip=1.1.1.1 name=Adrian&lt;BR /&gt;
ip=1.1.1.2 name=Alanis&lt;/P&gt;

&lt;P&gt;index =A  OR index= B |transaction ip | table ip, myfield, name&lt;BR /&gt;
1.1.1.1, x, Adrian&lt;BR /&gt;
1.1.1.2, y, Alanis&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2015 01:25:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130509#M35572</guid>
      <dc:creator>aalanisr26</dc:creator>
      <dc:date>2015-02-05T01:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130510#M35573</link>
      <description>&lt;P&gt;Thanks a lot!!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Feb 2015 17:44:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130510#M35573</guid>
      <dc:creator>sunitachan</dc:creator>
      <dc:date>2015-02-20T17:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130511#M35574</link>
      <description>&lt;P&gt;Thanks for the note!!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Feb 2015 17:44:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130511#M35574</guid>
      <dc:creator>sunitachan</dc:creator>
      <dc:date>2015-02-20T17:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130512#M35575</link>
      <description>&lt;P&gt;How would you write a query if ip is named as client_ip in index B ?  basically if same field value has different field  name in another index .&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 21:21:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130512#M35575</guid>
      <dc:creator>damode</dc:creator>
      <dc:date>2017-12-14T21:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130513#M35576</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; ... | eval correlation_field=case(isnotnull(ip), ip, isnotnull(client_ip), client_ip, 1=1, "unknown")
 | stats values(*) AS * by correlation_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 21:25:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130513#M35576</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-12-14T21:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130514#M35577</link>
      <description>&lt;P&gt;Hi MuS,&lt;/P&gt;

&lt;P&gt;In my two indexes,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=a
host=system
action=deleted
userid
ip

index=b
client_ip
sender
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am trying to figure out a query that will match &lt;CODE&gt;ip&lt;/CODE&gt; from &lt;CODE&gt;index A&lt;/CODE&gt; with &lt;CODE&gt;client_ip&lt;/CODE&gt; of &lt;CODE&gt;index B&lt;/CODE&gt; and merge results giving userid, ip sender and action as tables.&lt;/P&gt;

&lt;P&gt;I have tried below query, but it only gave me results from index a&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=a host=system action=deleted OR index=b |transaction ip |table userid, ip, action, sender | eval correlation_field=case(isnotnull(ip), ip, isnotnull(client_ip), client_ip, 1=1, "unknown")
  | stats values(*) AS * by correlation_field
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Dec 2017 22:09:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130514#M35577</guid>
      <dc:creator>damode</dc:creator>
      <dc:date>2017-12-14T22:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130515#M35578</link>
      <description>&lt;P&gt;Just try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( index=a host=system action=deleted ip=* ) OR ( index=b client_ip=* sender=* )
| fields userid, ip, action, sender, client_ip
| eval correlation_field=case(isnotnull(ip), ip, isnotnull(client_ip), client_ip, 1=1, "unknown")
| stats values(*) AS * by correlation_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 01:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130515#M35578</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-12-15T01:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130516#M35579</link>
      <description>&lt;P&gt;I am getting expected results along with results specific to each index with no IP matching.&lt;/P&gt;

&lt;P&gt;one result  from just index A  is,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action, ip, userid
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;next is both results merged with IP matching (expected result)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action, ip, client_ip , sender, userid
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;another with results from just index B&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action, client_ip , sender.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and I noticed Index B also has same field "&lt;CODE&gt;action&lt;/CODE&gt;" like index A but with different values.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 02:08:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130516#M35579</guid>
      <dc:creator>damode</dc:creator>
      <dc:date>2017-12-15T02:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130517#M35580</link>
      <description>&lt;P&gt;Look, I gave you an example how it can be done and you have the data available. All you need to do is adapt the search and try adding or removing fields before and after the &lt;CODE&gt;stats&lt;/CODE&gt; to get the expected result. &lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 02:51:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130517#M35580</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-12-15T02:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130518#M35581</link>
      <description>&lt;P&gt;But how do we do if the field names are different in both indexes?&lt;/P&gt;

&lt;P&gt;Example:&lt;BR /&gt;
If Index A lists ip address as IP and Index B lists it as IPaddr&lt;/P&gt;</description>
      <pubDate>Sat, 11 Aug 2018 17:41:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130518#M35581</guid>
      <dc:creator>harishbenne2</dc:creator>
      <dc:date>2018-08-11T17:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130519#M35582</link>
      <description>&lt;P&gt;hmm, exactly as already posted and described below ....&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | eval correlation_field=case(isnotnull(IP), IP, isnotnull(IPaddr), IPaddr, 1=1, "unknown")
 | stats values(*) AS * by correlation_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Sat, 11 Aug 2018 20:59:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130519#M35582</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-08-11T20:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to correlate data from multiple indexes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130520#M35583</link>
      <description>&lt;P&gt;... &lt;CODE&gt;coalesce()&lt;/CODE&gt; ... &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Aug 2018 04:38:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-correlate-data-from-multiple-indexes/m-p/130520#M35583</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2018-08-12T04:38:52Z</dc:date>
    </item>
  </channel>
</rss>

