<?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 Attempting to use rex to extract a session id, how to deal with special characters? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Attempting-to-use-rex-to-extract-a-session-id-how-to-deal-with/m-p/287147#M86913</link>
    <description>&lt;P&gt;I need to extract a session ID out of events, but the special character is causing me problems.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Oct 22 08:33:30 192.168.7.251 postfix/smtp[76654]: 67BE5D1332D0A82F:
    System: MTA, Source (Reason): None, Action: sent
Oct 22 08:33:30 192.168.7.251 postfix/smtp[76654]: 67BE5D1332D0A82F: to=&amp;lt;jbubba@test.org&amp;gt;, delay=0.42, delays=0.41/0/0/0.01, dsn=2.6.0, status=sent (250 2.6.0  &amp;lt;jCAHxoxnu--VD2tu+N8wyHgGndydf=-5Q1H6CVBXc5z82iyQOmWA@mail.gmail.com&amp;gt; Queued mail for delivery)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to extract &lt;CODE&gt;67BE5D1332D0A82F&lt;/CODE&gt;.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=WatchGuard  67BE5D1332D0A82F | rex field=_raw "Session_ID: (?&amp;lt;\]\:&amp;gt;.\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above does not work.&lt;/P&gt;

&lt;P&gt;Any help would be appreciated,&lt;BR /&gt;
Thanks,&lt;BR /&gt;
John&lt;/P&gt;</description>
    <pubDate>Thu, 22 Oct 2015 15:31:05 GMT</pubDate>
    <dc:creator>john_glasscock</dc:creator>
    <dc:date>2015-10-22T15:31:05Z</dc:date>
    <item>
      <title>Attempting to use rex to extract a session id, how to deal with special characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Attempting-to-use-rex-to-extract-a-session-id-how-to-deal-with/m-p/287147#M86913</link>
      <description>&lt;P&gt;I need to extract a session ID out of events, but the special character is causing me problems.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Oct 22 08:33:30 192.168.7.251 postfix/smtp[76654]: 67BE5D1332D0A82F:
    System: MTA, Source (Reason): None, Action: sent
Oct 22 08:33:30 192.168.7.251 postfix/smtp[76654]: 67BE5D1332D0A82F: to=&amp;lt;jbubba@test.org&amp;gt;, delay=0.42, delays=0.41/0/0/0.01, dsn=2.6.0, status=sent (250 2.6.0  &amp;lt;jCAHxoxnu--VD2tu+N8wyHgGndydf=-5Q1H6CVBXc5z82iyQOmWA@mail.gmail.com&amp;gt; Queued mail for delivery)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to extract &lt;CODE&gt;67BE5D1332D0A82F&lt;/CODE&gt;.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=WatchGuard  67BE5D1332D0A82F | rex field=_raw "Session_ID: (?&amp;lt;\]\:&amp;gt;.\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above does not work.&lt;/P&gt;

&lt;P&gt;Any help would be appreciated,&lt;BR /&gt;
Thanks,&lt;BR /&gt;
John&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 15:31:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Attempting-to-use-rex-to-extract-a-session-id-how-to-deal-with/m-p/287147#M86913</guid>
      <dc:creator>john_glasscock</dc:creator>
      <dc:date>2015-10-22T15:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Attempting to use rex to extract a session id, how to deal with special characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Attempting-to-use-rex-to-extract-a-session-id-how-to-deal-with/m-p/287148#M86914</link>
      <description>&lt;P&gt;Your rex command is looking for the string "Session_ID: ", but that string does not exist in your examples.  This search finds the string you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=WatchGuard  67BE5D1332D0A82F | rex "\]: (?&amp;lt;session_id&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2015 16:38:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Attempting-to-use-rex-to-extract-a-session-id-how-to-deal-with/m-p/287148#M86914</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-10-22T16:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Attempting to use rex to extract a session id, how to deal with special characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Attempting-to-use-rex-to-extract-a-session-id-how-to-deal-with/m-p/287149#M86915</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=WatchGuard  67BE5D1332D0A82F  | rex "([^:]+:){3}(?&amp;lt;SessionId&amp;gt;[^:]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2015 16:41:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Attempting-to-use-rex-to-extract-a-session-id-how-to-deal-with/m-p/287149#M86915</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-10-22T16:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Attempting to use rex to extract a session id, how to deal with special characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Attempting-to-use-rex-to-extract-a-session-id-how-to-deal-with/m-p/287150#M86916</link>
      <description>&lt;P&gt;Thank you, I appreciate the help.&lt;BR /&gt;
I did take it one step farther by adding exact count for session_id to eliminate some random hits.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=WatchGuard  67BE5D1332D0A82F | rex "\]: (?\w{16})"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2015 18:04:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Attempting-to-use-rex-to-extract-a-session-id-how-to-deal-with/m-p/287150#M86916</guid>
      <dc:creator>john_glasscock</dc:creator>
      <dc:date>2015-10-22T18:04:31Z</dc:date>
    </item>
  </channel>
</rss>

