<?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 Matching a timestamp from two index events. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Matching-a-timestamp-from-two-index-events/m-p/496642#M84709</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I have two indexes with two different types of syslogs. Both logs contain a common field (username) and I would like to be able to pair them up to form a single event/result. &lt;/P&gt;

&lt;P&gt;Could someone please advise the best way to approach this task? I assume I would need to form a common field between the two event types but how would I then display the common field alongside independent fields from both indexes? &lt;/P&gt;

&lt;P&gt;I hope that makes sense, struggled to explain that one! &lt;/P&gt;

&lt;P&gt;Thank you! &lt;/P&gt;</description>
    <pubDate>Tue, 01 Oct 2019 18:23:45 GMT</pubDate>
    <dc:creator>danfinan</dc:creator>
    <dc:date>2019-10-01T18:23:45Z</dc:date>
    <item>
      <title>Matching a timestamp from two index events.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Matching-a-timestamp-from-two-index-events/m-p/496642#M84709</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I have two indexes with two different types of syslogs. Both logs contain a common field (username) and I would like to be able to pair them up to form a single event/result. &lt;/P&gt;

&lt;P&gt;Could someone please advise the best way to approach this task? I assume I would need to form a common field between the two event types but how would I then display the common field alongside independent fields from both indexes? &lt;/P&gt;

&lt;P&gt;I hope that makes sense, struggled to explain that one! &lt;/P&gt;

&lt;P&gt;Thank you! &lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 18:23:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Matching-a-timestamp-from-two-index-events/m-p/496642#M84709</guid>
      <dc:creator>danfinan</dc:creator>
      <dc:date>2019-10-01T18:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Matching a timestamp from two index events.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Matching-a-timestamp-from-two-index-events/m-p/496643#M84710</link>
      <description>&lt;P&gt;Greetings @danfinan,&lt;/P&gt;

&lt;P&gt;The efficient way to do this is to use &lt;CODE&gt;stats&lt;/CODE&gt;. Here's some sample data:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index1&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;username    field1
User1        abc
User2        def
User3        ghi
User4        -
User5        -
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;index2&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;username    field2
User1        xyz
User2        nop
User3        -
User4        klm
User5        -
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here's a run-anywhere search that will transform as you described:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;           | makeresults | eval username="User1", field1="abc"
| append [ | makeresults | eval username="User1", field2="xyz" ]
| append [ | makeresults | eval username="User2", field1="def" ]
| append [ | makeresults | eval username="User2", field2="nop" ]
| append [ | makeresults | eval username="User3", field1="ghi" ]
| append [ | makeresults | eval username="User4", field2="klm" ]
| append [ | makeresults | eval username="User5" ]
| stats values(field1) as field1 values(field2) as field2 by username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the output will look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;username    field1   field2
User1        abc      xyz
User2        def      nop
User3        ghi      -
User4        -        klm
User5        -        -
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
Jacob&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 18:46:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Matching-a-timestamp-from-two-index-events/m-p/496643#M84710</guid>
      <dc:creator>jacobpevans</dc:creator>
      <dc:date>2019-10-01T18:46:28Z</dc:date>
    </item>
  </channel>
</rss>

