<?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 help on field extraction? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64963#M16050</link>
    <description>&lt;P&gt;yes, something like:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
EXTRACT-loginfield = ^\S+\s+(?&amp;lt;login&amp;gt;\S+)
EXTRACT-Status = ^\S+\s+\S+\s+(?&amp;lt;status&amp;gt;\S+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;..etc..&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/4.1.5/admin/Propsconf" rel="nofollow"&gt;props.conf.spec&lt;/A&gt; for more info&lt;/P&gt;</description>
    <pubDate>Wed, 06 Oct 2010 23:33:57 GMT</pubDate>
    <dc:creator>Genti</dc:creator>
    <dc:date>2010-10-06T23:33:57Z</dc:date>
    <item>
      <title>REGEX help on field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64959#M16046</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to extract fields from events and here are the sample events:&lt;/P&gt;

&lt;P&gt;AUD_Proc        user1   OK          Thu Sep 16 15:09:45 2010 audit&lt;BR /&gt;
       pid: 0 cmd: 4    &lt;/P&gt;

&lt;P&gt;TCB_Exec        user1   OK          Thu Sep 16 15:09:45 2010 audit&lt;BR /&gt;
        filename: /usr/sbin/audit  &lt;/P&gt;

&lt;P&gt;CRON_Start      root     OK          Tue Oct 05 23:40:00 2010 cron  &lt;/P&gt;

&lt;P&gt;S_PASSWD_READ   root     OK          Tue Oct 05 23:40:00 2010 java                        &lt;/P&gt;

&lt;P&gt;I am tring to extract the "login" field (user1,root) but the generated pattern doesn't match all values.&lt;/P&gt;

&lt;P&gt;For example,if i selected user1 and root as the example values,the pattern generated only captures event for TCB_Exec,and not other events like AUD_Proc,CRON_Start &amp;amp; S_PASSWD_READ.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2010 14:31:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64959#M16046</guid>
      <dc:creator>remy06</dc:creator>
      <dc:date>2010-10-06T14:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help on field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64960#M16047</link>
      <description>&lt;P&gt;i think something like this should work for you:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = ^\w+ (\w+)
Yourfield  = $1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you can send a bigger log file i can be a bit more sure, but using a regex tester this works ok for me.&lt;/P&gt;

&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2010 14:43:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64960#M16047</guid>
      <dc:creator>Genti</dc:creator>
      <dc:date>2010-10-06T14:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help on field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64961#M16048</link>
      <description>&lt;P&gt;I would use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = ^\S+\s+(?&amp;lt;fieldname&amp;gt;\S+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Oct 2010 15:10:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64961#M16048</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-10-06T15:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help on field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64962#M16049</link>
      <description>&lt;P&gt;thanks for the prompt reply.&lt;/P&gt;

&lt;P&gt;Do I specify the commands you've provided in props.conf?&lt;/P&gt;

&lt;P&gt;Here is a list of examples where it contains 5 columns:&lt;BR /&gt;
(eg. event-FS_CHdir, login-user3, status-OK, time, command - tsm,su)etc  &lt;/P&gt;

&lt;P&gt;I'm trying to extract these fields for the 5 columns.&lt;/P&gt;

&lt;P&gt;FS_Chdir user3 OK Tue Oct 26 11:10:49 2004 tsm&lt;BR /&gt;
change current directory to: /home/user3  &lt;/P&gt;

&lt;P&gt;S_ENVIRON_WRITE user3 FAIL Tue Oct 26 11:10:49 2004 tsm&lt;BR /&gt;
audit object write event detected /etc/security/environ  &lt;/P&gt;

&lt;P&gt;S_PASSWD_READ user3 OK Tue Oct 26 11:10:50 2004 su&lt;BR /&gt;
audit object read event detected /etc/security/passwd  &lt;/P&gt;

&lt;P&gt;S_PASSWD_READ user3 OK Tue Oct 26 11:10:50 2004 su&lt;BR /&gt;
audit object read event detected /etc/security/passwd  &lt;/P&gt;

&lt;P&gt;USER_SU user3 OK Tue Oct 26 11:10:53 2004 su&lt;BR /&gt;
root&lt;/P&gt;

&lt;P&gt;AUD_Proc user1 OK Thu Sep 16 15:09:45 2010 audit&lt;BR /&gt;
pid: 0 cmd: 4&lt;/P&gt;

&lt;P&gt;TCB_Exec user1 OK Thu Sep 16 15:09:45 2010 audit&lt;BR /&gt;
filename: /usr/sbin/audit&lt;/P&gt;

&lt;P&gt;CRON_Start root OK Tue Oct 05 23:40:00 2010 cron &lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2010 16:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64962#M16049</guid>
      <dc:creator>remy06</dc:creator>
      <dc:date>2010-10-06T16:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help on field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64963#M16050</link>
      <description>&lt;P&gt;yes, something like:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
EXTRACT-loginfield = ^\S+\s+(?&amp;lt;login&amp;gt;\S+)
EXTRACT-Status = ^\S+\s+\S+\s+(?&amp;lt;status&amp;gt;\S+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;..etc..&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/4.1.5/admin/Propsconf" rel="nofollow"&gt;props.conf.spec&lt;/A&gt; for more info&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2010 23:33:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64963#M16050</guid>
      <dc:creator>Genti</dc:creator>
      <dc:date>2010-10-06T23:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help on field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64964#M16051</link>
      <description>&lt;P&gt;I see..thanks it works fine.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2010 11:39:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-help-on-field-extraction/m-p/64964#M16051</guid>
      <dc:creator>remy06</dc:creator>
      <dc:date>2010-10-07T11:39:10Z</dc:date>
    </item>
  </channel>
</rss>

