<?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 Splunk Left Join in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257302#M77047</link>
    <description>&lt;P&gt;Hi, I wonder whether someone may be able to help me please:&lt;/P&gt;

&lt;P&gt;I'm trying to return the following details:&lt;/P&gt;

&lt;P&gt;Submission Date&lt;BR /&gt;
Reference Number&lt;/P&gt;

&lt;P&gt;With the following criteria:&lt;/P&gt;

&lt;P&gt;Where the reference number has an auditType=FormSaved &lt;STRONG&gt;but does not have&lt;/STRONG&gt; the auditType=FormSubmission (Because it is possible to have both auditTypes for the same reference number)&lt;/P&gt;

&lt;P&gt;this is what I've put together so far, but I just can't get this to work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main auditSource=for-frontend auditType=FormSaved
    | eval generatedAt=strptime(generatedAt, "%Y-%m-%dT%H:%M:%S")|convert timeformat="%d/%b/%Y %H:%M" ctime(generatedAt)
    | rename generatedAt As "submissiondate"
    | table submissiondate detail.referenceNumber
    | join type=left detail.referenceNumber[search index=main auditSource=for-frontend NOT auditType=FormSubmission
    | eval generatedAt=strptime(generatedAt, "%Y-%m-%dT%H:%M:%S")|convert timeformat="%d/%b/%Y %H:%M" ctime(generatedAt)
    | rename generatedAt As "submissiondate"
    | table submissiondate detail.referenceNumber]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I just wondered whether someone could look at this please and let me know where I've gone wrong.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;</description>
    <pubDate>Fri, 27 Nov 2015 14:34:06 GMT</pubDate>
    <dc:creator>IRHM73</dc:creator>
    <dc:date>2015-11-27T14:34:06Z</dc:date>
    <item>
      <title>Splunk Left Join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257302#M77047</link>
      <description>&lt;P&gt;Hi, I wonder whether someone may be able to help me please:&lt;/P&gt;

&lt;P&gt;I'm trying to return the following details:&lt;/P&gt;

&lt;P&gt;Submission Date&lt;BR /&gt;
Reference Number&lt;/P&gt;

&lt;P&gt;With the following criteria:&lt;/P&gt;

&lt;P&gt;Where the reference number has an auditType=FormSaved &lt;STRONG&gt;but does not have&lt;/STRONG&gt; the auditType=FormSubmission (Because it is possible to have both auditTypes for the same reference number)&lt;/P&gt;

&lt;P&gt;this is what I've put together so far, but I just can't get this to work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main auditSource=for-frontend auditType=FormSaved
    | eval generatedAt=strptime(generatedAt, "%Y-%m-%dT%H:%M:%S")|convert timeformat="%d/%b/%Y %H:%M" ctime(generatedAt)
    | rename generatedAt As "submissiondate"
    | table submissiondate detail.referenceNumber
    | join type=left detail.referenceNumber[search index=main auditSource=for-frontend NOT auditType=FormSubmission
    | eval generatedAt=strptime(generatedAt, "%Y-%m-%dT%H:%M:%S")|convert timeformat="%d/%b/%Y %H:%M" ctime(generatedAt)
    | rename generatedAt As "submissiondate"
    | table submissiondate detail.referenceNumber]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I just wondered whether someone could look at this please and let me know where I've gone wrong.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2015 14:34:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257302#M77047</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-11-27T14:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Left Join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257303#M77048</link>
      <description>&lt;P&gt;You should be able to save yourself the join like so:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=main auditSource=for-frontend auditType=* | stats values(*) as * by detail.referenceNumber |search NOT auditType=FormSubmission | fields generatedAt detail.referenceNumber&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Depending on your data you may have multipll values in each cell now, but you should not have any detail.referenceNumbers that have an associated auditType=FormSubmission &lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2015 16:16:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257303#M77048</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2015-11-27T16:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Left Join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257304#M77049</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=main auditSource=for-frontend
 | stats values(*) AS * BY detail.referenceNumber
 | where auditType="FormSaved" AND NOT auditType="FormSubmission"
 | eval generatedAt=strptime(mvindex(generatedAt, 0), "%Y-%m-%dT%H:%M:%S")
 | convert timeformat="%d/%b/%Y %H:%M" ctime(generatedAt)
 | rename generatedAt AS "submissiondate"
 | table submissiondate detail.referenceNumber
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Nov 2015 16:16:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257304#M77049</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-27T16:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Left Join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257305#M77050</link>
      <description>&lt;P&gt;woodcock's is neater than mine - use his&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2015 16:17:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257305#M77050</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2015-11-27T16:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Left Join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257306#M77051</link>
      <description>&lt;P&gt;Hi @woodcock, thank you for taking the time to reply to my post and my apologies for not coming back to you sooner, but unfortunately, this is not extracting any information in the table.&lt;/P&gt;

&lt;P&gt;But I have managed to find the answer &lt;A href="https://answers.splunk.com/answers/37565/not-subsearch.html"&gt;here&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 06:25:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257306#M77051</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-12-02T06:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Left Join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257307#M77052</link>
      <description>&lt;P&gt;Hi @jplumsdaine22, thank you for taking the time to reply to my post.&lt;/P&gt;

&lt;P&gt;I made some changes your query changing auditType=* to auditType=FormSaved, and although this does return the fields in the table, it still displays those submissions which have both "FormSaved" and "FormSubmission" for the same reference number.&lt;/P&gt;

&lt;P&gt;But I have found the answer &lt;A href="https://answers.splunk.com/answers/37565/not-subsearch.html"&gt;here&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 06:32:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257307#M77052</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-12-02T06:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Left Join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257308#M77053</link>
      <description>&lt;P&gt;All,&lt;/P&gt;

&lt;P&gt;After searching the Splunk answers I found the solution &lt;A href="https://answers.splunk.com/answers/37565/not-subsearch.html"&gt;here&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So my final solution is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main auditSource=for-frontend auditType=FormSaved
     | eval generatedAt=strptime(generatedAt, "%Y-%m-%dT%H:%M:%S")|convert timeformat="%d/%b/%Y %H:%M" ctime(generatedAt)
     | rename generatedAt As "submissiondate"
     | table submissiondate detail.referenceNumber
     | search NOT[search index=main auditSource=for-frontend auditType=FormSubmission
     | table submissiondate detail.referenceNumber]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 07:07:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Left-Join/m-p/257308#M77053</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-12-02T07:07:45Z</dc:date>
    </item>
  </channel>
</rss>

