<?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 How do I correlate across two log sources? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-across-two-log-sources/m-p/629587#M218714</link>
    <description>&lt;P&gt;I am writing a query to correlate across two different indexes. One index has userID field. I want the query to match a field in the second index and output additional fields from the second index.&lt;/P&gt;
&lt;P&gt;index 'idx1' has field name usr. For the sake of this example, there is a user called 'jdoe'&lt;/P&gt;
&lt;P&gt;index 'idx2' has a field name called user, which contains 'jdoe' along with another field called account ID, which has the name spelled out 'John Doe'. I want the query to use the usr field content from idx1 and use that info to pull the contents of 'account ID' field in index.&lt;/P&gt;
&lt;P&gt;What's the best way to accomplish this?&lt;/P&gt;</description>
    <pubDate>Mon, 06 Feb 2023 00:09:29 GMT</pubDate>
    <dc:creator>Splunk77</dc:creator>
    <dc:date>2023-02-06T00:09:29Z</dc:date>
    <item>
      <title>How do I correlate across two log sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-across-two-log-sources/m-p/629587#M218714</link>
      <description>&lt;P&gt;I am writing a query to correlate across two different indexes. One index has userID field. I want the query to match a field in the second index and output additional fields from the second index.&lt;/P&gt;
&lt;P&gt;index 'idx1' has field name usr. For the sake of this example, there is a user called 'jdoe'&lt;/P&gt;
&lt;P&gt;index 'idx2' has a field name called user, which contains 'jdoe' along with another field called account ID, which has the name spelled out 'John Doe'. I want the query to use the usr field content from idx1 and use that info to pull the contents of 'account ID' field in index.&lt;/P&gt;
&lt;P&gt;What's the best way to accomplish this?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 00:09:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-across-two-log-sources/m-p/629587#M218714</guid>
      <dc:creator>Splunk77</dc:creator>
      <dc:date>2023-02-06T00:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Correlate across two log sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-across-two-log-sources/m-p/629589#M218715</link>
      <description>&lt;P&gt;You could do that with join or append, but that would be a waste of resources.&amp;nbsp; I simple disjunction will do.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=idx1 usr=*) OR (index=idx2 user=*)
``` Set the user field to user or usr, depending which exists in the event ```
| eval user = coalesce(user, usr)
``` Group events by user ```
| stats values(accountID) as accountID by user
| table user accountID&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 04 Feb 2023 01:23:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-across-two-log-sources/m-p/629589#M218715</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-02-04T01:23:54Z</dc:date>
    </item>
  </channel>
</rss>

