<?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: Can you help me with a field extraction using REGEX? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429791#M173365</link>
    <description>&lt;P&gt;can you paste your entire event in &lt;CODE&gt;101010&lt;/CODE&gt; sample code as it looks like in splunk.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jan 2019 11:35:01 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2019-01-28T11:35:01Z</dc:date>
    <item>
      <title>Can you help me with a field extraction using REGEX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429786#M173360</link>
      <description>&lt;P&gt;Hi all, &lt;/P&gt;

&lt;P&gt;I am getting an event in the below format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; 28/01/2019
    07:20:54.000    
 USERNAME           FROM             LATEST
Test1            10.0.0.1          Jan 25 15:42:07 2018
admin          10.0.1.31        Jan 15 14:11:26 2019
osadmin      10.0.10.12     Jan 23 16:38:12 2019
awa              10.13.5.21     Oct 1 14:15:16 2018
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am trying to extract USERNAME , FROM ,LATEST as a field using field extraction method. I tried the REGEX for Username like this :&lt;BR /&gt;
&lt;CODE&gt;^(?P\w+\s+)&lt;/CODE&gt;,  but when I am running the field extraction , it is giving me the Results "USERNAME" only .&lt;/P&gt;

&lt;P&gt;Please help me to extract USERNAME,FROM,LATEST from the event via field extraction. &lt;/P&gt;

&lt;P&gt;Thanks &lt;/P&gt;

&lt;P&gt;Rohit &lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 07:31:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429786#M173360</guid>
      <dc:creator>rohitvjoshi</dc:creator>
      <dc:date>2019-01-28T07:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a field extraction using REGEX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429787#M173361</link>
      <description>&lt;P&gt;Is each line a different event? When you are trying to get regex's correct, you can test them directly in the search like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | rex "^\s*(?&amp;lt;a_username&amp;gt;\S+)\s+(?&amp;lt;a_from&amp;gt;\S+)\s+(?&amp;lt;a_latest&amp;gt;.+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Then you should see your fields extracted. if they aren't correct, adjust the &lt;CODE&gt;rex&lt;/CODE&gt; as required.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 07:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429787#M173361</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-01-28T07:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a field extraction using REGEX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429788#M173362</link>
      <description>&lt;P&gt;hi can you try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_index | rex field=_raw "(?&amp;lt;username&amp;gt;\w+)\s(?&amp;lt;from&amp;gt;\d{1,2}\.\d{1,2}\.\d{1,2}\.\d{1,2})\s(?&amp;lt;latest&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if there are multiple usernames in 1 event then you need to add &lt;CODE&gt;max_match=0&lt;/CODE&gt; in &lt;CODE&gt;rex&lt;/CODE&gt; command.&lt;/P&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 10:10:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429788#M173362</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-01-28T10:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a field extraction using REGEX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429789#M173363</link>
      <description>&lt;P&gt;No Luck &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 11:31:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429789#M173363</guid>
      <dc:creator>rohitvjoshi</dc:creator>
      <dc:date>2019-01-28T11:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a field extraction using REGEX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429790#M173364</link>
      <description>&lt;P&gt;No , this is Single event which gives me the information about the users who logged in into UNIX Servers. &lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 11:32:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429790#M173364</guid>
      <dc:creator>rohitvjoshi</dc:creator>
      <dc:date>2019-01-28T11:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a field extraction using REGEX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429791#M173365</link>
      <description>&lt;P&gt;can you paste your entire event in &lt;CODE&gt;101010&lt;/CODE&gt; sample code as it looks like in splunk.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 11:35:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429791#M173365</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-01-28T11:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a field extraction using REGEX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429792#M173366</link>
      <description>&lt;P&gt;Try this then:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | multikv noheader=t | rex "^\s*(?&amp;lt;a_username&amp;gt;\S+)\s+(?&amp;lt;a_from&amp;gt;\S+)\s+(?&amp;lt;a_latest&amp;gt;.+)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 11:47:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429792#M173366</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-01-28T11:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a field extraction using REGEX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429793#M173367</link>
      <description>&lt;P&gt;Try this one:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;gt;  | rex "^(?P&amp;lt;myfield&amp;gt;\w\s\w\s\w)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Jan 2019 17:00:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429793#M173367</guid>
      <dc:creator>rutdesanti</dc:creator>
      <dc:date>2019-01-28T17:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a field extraction using REGEX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429794#M173368</link>
      <description>&lt;P&gt;Thanks ,It workes &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 06:58:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-field-extraction-using-REGEX/m-p/429794#M173368</guid>
      <dc:creator>rohitvjoshi</dc:creator>
      <dc:date>2019-01-29T06:58:44Z</dc:date>
    </item>
  </channel>
</rss>

