<?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 email events when the key-id is not defined in all events? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-email-events-when-the-key-id-is-not-defined/m-p/426812#M122285</link>
    <description>&lt;P&gt;So I have correlated email events before where there was a UID defined as a field for all transactions of a unique email session.   For example, the event containing "subject" contained a UID=xyz123 and the event containing "sender" contained a UID=xyz123, and the event containing "recipient" contained a UID=xyz123, etc...&lt;/P&gt;

&lt;P&gt;Now I am faced with transaction-events where the event containing "subject" has a UID=abc987, but the "to" and "from" events only have "abc987" and no field name...&lt;/P&gt;

&lt;P&gt;I can regex the UID value out of the "to" and "from" events, but I have not been successful stitching the events together to create the complete email session...&lt;/P&gt;

&lt;P&gt;For example, If I run this query below I can get the unique ids which will be contained in all events related to a unique email session... (by session I mean Subject, To, From, etc...)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=mail sourcetype=mail | rex field=_raw "sendmail+\S+\s(?&amp;lt;stitcher&amp;gt;[[:alnum:]]+)"|fillnull value="null"| table stitcher | WHERE stitcher!="null" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;here are some sample results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stitcher
w9FD0v3f024155
w9CCWGaF023575
w9CCAwjU026498
w9AEM7sO030350
w9ADp31g031379
w993gkLc016485
w993gjU0016459
w993UuOr000878
w9CDhH42016767
w9CDV93a026891
w9CDVAv6018597
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I search with each of theses UIDs 1 by 1, I would only get the events related to a specific email.&lt;/P&gt;

&lt;P&gt;So I tried a number of subsearches but I am having no luck...I need to feed the list back into a search and be able to list out the subject, to, and from, by UID...&lt;/P&gt;

&lt;P&gt;Looking for advice.&lt;BR /&gt;
Thank you&lt;/P&gt;</description>
    <pubDate>Mon, 15 Oct 2018 23:23:48 GMT</pubDate>
    <dc:creator>Log_wrangler</dc:creator>
    <dc:date>2018-10-15T23:23:48Z</dc:date>
    <item>
      <title>How do I correlate email events when the key-id is not defined in all events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-email-events-when-the-key-id-is-not-defined/m-p/426812#M122285</link>
      <description>&lt;P&gt;So I have correlated email events before where there was a UID defined as a field for all transactions of a unique email session.   For example, the event containing "subject" contained a UID=xyz123 and the event containing "sender" contained a UID=xyz123, and the event containing "recipient" contained a UID=xyz123, etc...&lt;/P&gt;

&lt;P&gt;Now I am faced with transaction-events where the event containing "subject" has a UID=abc987, but the "to" and "from" events only have "abc987" and no field name...&lt;/P&gt;

&lt;P&gt;I can regex the UID value out of the "to" and "from" events, but I have not been successful stitching the events together to create the complete email session...&lt;/P&gt;

&lt;P&gt;For example, If I run this query below I can get the unique ids which will be contained in all events related to a unique email session... (by session I mean Subject, To, From, etc...)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=mail sourcetype=mail | rex field=_raw "sendmail+\S+\s(?&amp;lt;stitcher&amp;gt;[[:alnum:]]+)"|fillnull value="null"| table stitcher | WHERE stitcher!="null" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;here are some sample results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stitcher
w9FD0v3f024155
w9CCWGaF023575
w9CCAwjU026498
w9AEM7sO030350
w9ADp31g031379
w993gkLc016485
w993gjU0016459
w993UuOr000878
w9CDhH42016767
w9CDV93a026891
w9CDVAv6018597
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I search with each of theses UIDs 1 by 1, I would only get the events related to a specific email.&lt;/P&gt;

&lt;P&gt;So I tried a number of subsearches but I am having no luck...I need to feed the list back into a search and be able to list out the subject, to, and from, by UID...&lt;/P&gt;

&lt;P&gt;Looking for advice.&lt;BR /&gt;
Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 23:23:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-email-events-when-the-key-id-is-not-defined/m-p/426812#M122285</guid>
      <dc:creator>Log_wrangler</dc:creator>
      <dc:date>2018-10-15T23:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I correlate email events when the key-id is not defined in all events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-email-events-when-the-key-id-is-not-defined/m-p/426813#M122286</link>
      <description>&lt;P&gt;If you have common unique values for different fields, would not be easier to rename them all and then apply a transaction command on the renamed field? Something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rename subject as UID | rex "sendmail+\S+\s(?&amp;lt;UID&amp;gt;[[:alnum:]]+)" | transaction UID 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the time and format of the events are always the same you can add further options to the transaction, something like &lt;BR /&gt;
&lt;CODE&gt;| transaction UID startswith=subject endswith=to&lt;/CODE&gt; and/or &lt;CODE&gt;| transaction UID maxevents=3&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 07:30:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-email-events-when-the-key-id-is-not-defined/m-p/426813#M122286</guid>
      <dc:creator>jlelli</dc:creator>
      <dc:date>2018-10-16T07:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I correlate email events when the key-id is not defined in all events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-email-events-when-the-key-id-is-not-defined/m-p/426814#M122287</link>
      <description>&lt;P&gt;that is an idea I will try.... thank you&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 19:39:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-email-events-when-the-key-id-is-not-defined/m-p/426814#M122287</guid>
      <dc:creator>Log_wrangler</dc:creator>
      <dc:date>2018-10-16T19:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I correlate email events when the key-id is not defined in all events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-email-events-when-the-key-id-is-not-defined/m-p/426815#M122288</link>
      <description>&lt;P&gt;I had to use a combo of regex and transaction.  Thx&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 16:37:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-correlate-email-events-when-the-key-id-is-not-defined/m-p/426815#M122288</guid>
      <dc:creator>Log_wrangler</dc:creator>
      <dc:date>2018-11-09T16:37:47Z</dc:date>
    </item>
  </channel>
</rss>

