<?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: RegEx field extraction help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39664#M9072</link>
    <description>&lt;P&gt;I tried with Duration, but it does not work, does not even show up. &lt;/P&gt;

&lt;P&gt;The Username and IP it tries to classify them as a similar extracted field:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;EXTRACT-Portal_User (?i) User &amp;lt;(?P&amp;lt;Portal_User&amp;gt;[^&amp;gt;]+)&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;EXTRACT-Portal_IP : (?i) IP &amp;lt;(?P&amp;lt;Portal_IP&amp;gt;[^&amp;gt;]+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Does it have anything to do with the hyphen in the extraction field name? &lt;/P&gt;

&lt;P&gt;Tried with this: &lt;BR /&gt;
&lt;CODE&gt;(?i)\-Users, Username = (?P&amp;lt;AnyConnectVPN_Users&amp;gt;[^,]+)&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;And it produced a proper &lt;UNKNOWN&gt; but also a lot of blank lines on the table&lt;/UNKNOWN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 20 May 2013 15:33:57 GMT</pubDate>
    <dc:creator>pdgill314</dc:creator>
    <dc:date>2013-05-20T15:33:57Z</dc:date>
    <item>
      <title>RegEx field extraction help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39662#M9070</link>
      <description>&lt;P&gt;I have this raw data:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;May 20 09:11:09 172.16.20.111 May 20 2013 09:11:09: %ASA-4-113019: Group = AC-Users, Username = &amp;lt;Unknown&amp;gt;, IP = 10.20.50.67, Session disconnected. Session Type: AnyConnect-Parent, Duration: 0h:05m:03s, Bytes xmt: 0, Bytes rcv: 0, Reason: User Requested&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;But when I attempt to extract out: &lt;UNKNOWN&gt; or 10.20.50.67 or 0h:05m:03s, it does not appear in the list of identified fields. I think it has something to do with the equals sign. Most the time the &lt;UNKNOWN&gt; contains a user's ID.&lt;/UNKNOWN&gt;&lt;/UNKNOWN&gt;&lt;/P&gt;

&lt;P&gt;I tried like this: &lt;BR /&gt;
&lt;CODE&gt;(?i)\-Parent, (?P&amp;lt;AC-Users_Duration&amp;gt;[^,]+)&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Any help is appreciated. &lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2013 14:29:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39662#M9070</guid>
      <dc:creator>pdgill314</dc:creator>
      <dc:date>2013-05-20T14:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx field extraction help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39663#M9071</link>
      <description>&lt;P&gt;You should be able to grab them like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Username = (?&amp;lt;username&amp;gt;[^,]+)
IP = (?&amp;lt;ip&amp;gt;[^,]+)
Duration: (?&amp;lt;duration&amp;gt;[^,]+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 May 2013 15:22:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39663#M9071</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-05-20T15:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx field extraction help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39664#M9072</link>
      <description>&lt;P&gt;I tried with Duration, but it does not work, does not even show up. &lt;/P&gt;

&lt;P&gt;The Username and IP it tries to classify them as a similar extracted field:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;EXTRACT-Portal_User (?i) User &amp;lt;(?P&amp;lt;Portal_User&amp;gt;[^&amp;gt;]+)&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;EXTRACT-Portal_IP : (?i) IP &amp;lt;(?P&amp;lt;Portal_IP&amp;gt;[^&amp;gt;]+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Does it have anything to do with the hyphen in the extraction field name? &lt;/P&gt;

&lt;P&gt;Tried with this: &lt;BR /&gt;
&lt;CODE&gt;(?i)\-Users, Username = (?P&amp;lt;AnyConnectVPN_Users&amp;gt;[^,]+)&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;And it produced a proper &lt;UNKNOWN&gt; but also a lot of blank lines on the table&lt;/UNKNOWN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2013 15:33:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39664#M9072</guid>
      <dc:creator>pdgill314</dc:creator>
      <dc:date>2013-05-20T15:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx field extraction help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39665#M9073</link>
      <description>&lt;P&gt;That regex does not add up with the sample logs you provided in your question. &lt;/P&gt;

&lt;P&gt;So as martin_mueller so nicely described them - put this in your props.conf:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[your sourcetype]&lt;BR /&gt;
EXTRACT-user = Username\s+=\s+(?&amp;lt;user&amp;gt;[^,]+)&lt;BR /&gt;
EXTRACT-duration = Duration:\s+(?&amp;lt;dur&amp;gt;[^,]+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2013 15:45:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39665#M9073</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-05-20T15:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx field extraction help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39666#M9074</link>
      <description>&lt;P&gt;I think I got it. Thanks martin_mueller&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2013 15:51:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39666#M9074</guid>
      <dc:creator>pdgill314</dc:creator>
      <dc:date>2013-05-20T15:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx field extraction help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39667#M9075</link>
      <description>&lt;P&gt;how do you guys get the brackets and backslashes to show up in splunk base?&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2013 18:34:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39667#M9075</guid>
      <dc:creator>alexl1</dc:creator>
      <dc:date>2013-05-20T18:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx field extraction help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39668#M9076</link>
      <description>&lt;P&gt;Put four spaces in front of the line to get it to show as-is in a grey box like in my answer. Within a line, you can escape characters with a single backslash in front of them.&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2013 20:29:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-field-extraction-help/m-p/39668#M9076</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-05-20T20:29:04Z</dc:date>
    </item>
  </channel>
</rss>

