<?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 do I join two searches that both include rex field extractions? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229540#M67986</link>
    <description>&lt;P&gt;The OR will return events from both audit sources and the rex will extract the field you want.&lt;BR /&gt;
If you then use stats to count by SessionID, you'll get the totals the way you want because it's present in both event types. Assuming your regex works fine of course.&lt;/P&gt;

&lt;P&gt;Let me know if that works&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jan 2016 09:56:25 GMT</pubDate>
    <dc:creator>javiergn</dc:creator>
    <dc:date>2016-01-12T09:56:25Z</dc:date>
    <item>
      <title>How do I join two searches that both include rex field extractions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229536#M67982</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I wonder whether someone may be able to help me please.&lt;/P&gt;

&lt;P&gt;I have the following two searches:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main auditSource="agent-f" auditType=ServiceSentResponse detail.referrer="*deletion*"  "detail.Location"="/agent/verification-list" 
|rex field="tags.X-Session-ID" "session\-(?&amp;lt;SessionID&amp;gt;[\S]+)"
|stats count(SessionID) as "Number of Clients Deleted" by SessionID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main auditSource="agent-p" auditType=MetricGetClientListTotal 
| rex field="tags.X-Session-ID" "session\-(?&amp;lt;SessionID&amp;gt;[\S]+)"
| stats count by SessionID detail.agent-code
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I'm trying to do is join them using the SessionID, and then create a table at the end which displays the fields &lt;STRONG&gt;detail.agent-code&lt;/STRONG&gt; and &lt;STRONG&gt;Number of Clients Deleted&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;I have used join before, but never where regex events have had to be written i.e using 'explicit' rather than 'implicit' events.&lt;/P&gt;

&lt;P&gt;I just wonder whether someone may be able to look at this please and offer some guidance on how I may be able to do this.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 09:26:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229536#M67982</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2016-01-12T09:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I join two searches that both include rex field extractions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229537#M67983</link>
      <description>&lt;P&gt;Could you use something like this instead?&lt;BR /&gt;
Whenever possible try to avoid using join (performance, limits, etc)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=main auditSource="agent-f" auditType=ServiceSentResponse detail.referrer="*deletion*"  "detail.Location"="/agent/verification-list") OR (index=main auditSource="agent-p" auditType=MetricGetClientListTotal) 
 |rex field="tags.X-Session-ID" "session\-(?&amp;lt;SessionID&amp;gt;[\S]+)"
 | yourstatsquery
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Jan 2016 09:47:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229537#M67983</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-01-12T09:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I join two searches that both include rex field extractions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229538#M67984</link>
      <description>&lt;P&gt;Hello Chris,&lt;/P&gt;

&lt;P&gt;A simple join should work here unless you have some other hidden complexities.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=main auditSource="agent-f" auditType=ServiceSentResponse detail.referrer="*deletion*"  "detail.Location"="/agent/verification-list" 
 |rex field="tags.X-Session-ID" "session\-(?&amp;lt;SessionID&amp;gt;[\S]+)"
 |stats count(SessionID) as "Number of Clients Deleted" by SessionID
|join SessionID  [search  index=main auditSource="agent-p" auditType=MetricGetClientListTotal 
 | rex field="tags.X-Session-ID" "session\-(?&amp;lt;SessionID&amp;gt;[\S]+)"
 | stats count by SessionID detail.agent-code]|table "Number of Clients Deleted" detail.agent-code
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, somehow you should be able to combine these searches instead of join. Just  a suggestion &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 09:51:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229538#M67984</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-01-12T09:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I join two searches that both include rex field extractions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229539#M67985</link>
      <description>&lt;P&gt;Hi @javiergn, I have to admit I initially thought that this wouldn't work because of the 'OR' statement. But this works great.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 09:52:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229539#M67985</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2016-01-12T09:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I join two searches that both include rex field extractions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229540#M67986</link>
      <description>&lt;P&gt;The OR will return events from both audit sources and the rex will extract the field you want.&lt;BR /&gt;
If you then use stats to count by SessionID, you'll get the totals the way you want because it's present in both event types. Assuming your regex works fine of course.&lt;/P&gt;

&lt;P&gt;Let me know if that works&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 09:56:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229540#M67986</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-01-12T09:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I join two searches that both include rex field extractions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229541#M67987</link>
      <description>&lt;P&gt;Hi @renjit.nair, thank you for taking the time to reply to my post. It certainly helps with boosting my knowledge of the 'Join' function. As you will see @javiergn has combined the queries for me.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 09:57:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229541#M67987</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2016-01-12T09:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I join two searches that both include rex field extractions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229542#M67988</link>
      <description>&lt;P&gt;Sincere thanks for the confirmation. You will see, probably while you were writing, that I tried the code and amended my response.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 10:00:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-join-two-searches-that-both-include-rex-field/m-p/229542#M67988</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2016-01-12T10:00:21Z</dc:date>
    </item>
  </channel>
</rss>

