<?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: Using Transaction command with two extracted join fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Transaction-command-with-two-extracted-join-fields/m-p/594315#M206845</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/196448"&gt;@jbrenner&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2022 16:10:21 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-04-19T16:10:21Z</dc:date>
    <item>
      <title>How to use Transaction command with two extracted join fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Transaction-command-with-two-extracted-join-fields/m-p/594298#M206839</link>
      <description>&lt;P&gt;I have two Splunk queries, each of which uses the &lt;STRONG&gt;_rex&lt;/STRONG&gt; command to extract the join field.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;QUERY 1
index=index1 "Query1" | rex field=_raw "abc(?&amp;lt;MY_JOIN_FIELD&amp;gt;def)"

QUERY 2
index=index2 "Query2" | rex field=_raw "ghi(?&amp;lt;MY_JOIN_FIELD&amp;gt;jkl)"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to use the Transaction command to correlate these two queries, but I can't figure out how to do it.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Jonathan&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 15:50:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Transaction-command-with-two-extracted-join-fields/m-p/594298#M206839</guid>
      <dc:creator>jbrenner</dc:creator>
      <dc:date>2022-04-19T15:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using Transaction command with two extracted join fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Transaction-command-with-two-extracted-join-fields/m-p/594310#M206843</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/196448"&gt;@jbrenner&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you should try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1  
| rex field=_raw "abc(?&amp;lt;MY_JOIN_FIELD&amp;gt;def)"
| append [ search 
     index=index2 
     | rex field=_raw "ghi(?&amp;lt;MY_JOIN_FIELD&amp;gt;jkl)"
     ]
| transaction &amp;lt;MY_JOIN_FIELD&amp;gt;
| ...&lt;/LI-CODE&gt;&lt;P&gt;otherwise, you could extract both the MY_JOIN_FIELD before so you don't need to extract them in the search, in other words:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 OR index=index2
| transaction &amp;lt;MY_JOIN_FIELD&amp;gt;
| ...&lt;/LI-CODE&gt;&lt;P&gt;But i invite you to think in a different way:&lt;/P&gt;&lt;P&gt;At first extract the two fields before and then try to use stats command instead of transaction:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 OR index=index2
| stats values(field1) AS field1 values(field2) AS field2 values(field3) AS field3 BY &amp;lt;MY_JOIN_FIELD&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;where field1, field2 and field3 are the fields you need in your events.&lt;/P&gt;&lt;P&gt;This solution is very much performant than using transaction.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 15:51:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Transaction-command-with-two-extracted-join-fields/m-p/594310#M206843</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-04-19T15:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using Transaction command with two extracted join fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Transaction-command-with-two-extracted-join-fields/m-p/594315#M206845</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/196448"&gt;@jbrenner&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 16:10:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Transaction-command-with-two-extracted-join-fields/m-p/594315#M206845</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-04-19T16:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using Transaction command with two extracted join fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Transaction-command-with-two-extracted-join-fields/m-p/594316#M206846</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;Thanks Giuseppe! Worked like a charm! I originally considered your alternative solution, but this is a one-off scenario, and it's unlikely we will ever use these extracted fields again.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 16:13:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Transaction-command-with-two-extracted-join-fields/m-p/594316#M206846</guid>
      <dc:creator>jbrenner</dc:creator>
      <dc:date>2022-04-19T16:13:11Z</dc:date>
    </item>
  </channel>
</rss>

