<?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: Regular expression in Splunk for extracting fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-in-Splunk-for-extracting-fields/m-p/353685#M104676</link>
    <description>&lt;P&gt;Try this to extract the value into a field called "accountid". This assumes the value you are trying to extract contains no spaces. You will need to clarify the expected value if it can contain spaces.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YOUR BASE SEARCH&amp;gt;
| rex field=_raw "[A|a]ccount\s+(?&amp;lt;accountid&amp;gt;[^\s]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 14 Mar 2017 11:59:30 GMT</pubDate>
    <dc:creator>rjthibod</dc:creator>
    <dc:date>2017-03-14T11:59:30Z</dc:date>
    <item>
      <title>Regular expression in Splunk for extracting fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-in-Splunk-for-extracting-fields/m-p/353684#M104675</link>
      <description>&lt;P&gt;I have some uneven stings and I need to extract a field from all the strings. Unique thing is the required field lies next to a common word in all the strings.&lt;/P&gt;

&lt;P&gt;below are some some example for the strings&lt;/P&gt;

&lt;P&gt;UTC Tue Jan 31 06:42:59 2017 [AE-214OX - 11.4.65.91] Anmelden bei &lt;STRONG&gt;Account&lt;/STRONG&gt; Administrator&lt;BR /&gt;
UTC Tue Jan 31 09:10:07 2017 [CB-Z0OaB - 11.4.65.91] Login for &lt;STRONG&gt;account&lt;/STRONG&gt; abc2ab (abc2ab)&lt;BR /&gt;
UTC Tue Jan 31 15:04:29 2017 [AE-214OX - 11.4.65.91] Anmeldeversuch für &lt;STRONG&gt;Account&lt;/STRONG&gt; def3abc fehlgeschlagen&lt;BR /&gt;
UTC Mon Feb 06 15:38:41 2017 [AE-214OX - 11.4.65.91] Failed login for &lt;STRONG&gt;account&lt;/STRONG&gt; testuser&lt;/P&gt;

&lt;P&gt;The above are few example strings. from which I need to extract the very next word, which lies next to account from all the all the strings. &lt;BR /&gt;
Note: the word account lies in both upper and lower case.&lt;/P&gt;

&lt;P&gt;Can some one help me with a regular expression to extract the field next to word account.&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 05:39:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression-in-Splunk-for-extracting-fields/m-p/353684#M104675</guid>
      <dc:creator>Gowtham0809</dc:creator>
      <dc:date>2017-03-14T05:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression in Splunk for extracting fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-in-Splunk-for-extracting-fields/m-p/353685#M104676</link>
      <description>&lt;P&gt;Try this to extract the value into a field called "accountid". This assumes the value you are trying to extract contains no spaces. You will need to clarify the expected value if it can contain spaces.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YOUR BASE SEARCH&amp;gt;
| rex field=_raw "[A|a]ccount\s+(?&amp;lt;accountid&amp;gt;[^\s]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Mar 2017 11:59:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression-in-Splunk-for-extracting-fields/m-p/353685#M104676</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-03-14T11:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression in Splunk for extracting fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-in-Splunk-for-extracting-fields/m-p/353686#M104677</link>
      <description>&lt;P&gt;Thank you, Its works as expected &lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2017 05:39:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression-in-Splunk-for-extracting-fields/m-p/353686#M104677</guid>
      <dc:creator>Gowtham0809</dc:creator>
      <dc:date>2017-03-15T05:39:20Z</dc:date>
    </item>
  </channel>
</rss>

