<?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: rex command to extract fields from field( Message=Document 345, Microsoft Word Text **owned by** first.last **on** abc1234 **was** some text **on** some text.............)? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165082#M46888</link>
    <description>&lt;P&gt;I am using the first one.It worked perfectly.&lt;BR /&gt;
 Thank you very much and appreciate your help. &lt;/P&gt;</description>
    <pubDate>Sun, 26 Apr 2015 04:06:37 GMT</pubDate>
    <dc:creator>sabithanitg</dc:creator>
    <dc:date>2015-04-26T04:06:37Z</dc:date>
    <item>
      <title>rex command to extract fields from field( Message=Document 345, Microsoft Word Text **owned by** first.last **on** abc1234 **was** some text **on** some text.............)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165076#M46882</link>
      <description>&lt;P&gt;rex command to extract fields from Message=Document 345, Microsoft Word Text &lt;STRONG&gt;owned by&lt;/STRONG&gt; first.last &lt;STRONG&gt;on&lt;/STRONG&gt; abc1234 &lt;STRONG&gt;was&lt;/STRONG&gt; some text &lt;STRONG&gt;on&lt;/STRONG&gt; some text.............&lt;BR /&gt;
Marked with bold text are common in all the values.&lt;/P&gt;

&lt;P&gt;result of field names should look like this.&lt;/P&gt;

&lt;P&gt;DocumentNum=Document 345&lt;BR /&gt;
DocumentType = Microsoft Word Text &lt;BR /&gt;
username=first.last&lt;BR /&gt;
device=abc1234&lt;BR /&gt;
location=some text&lt;/P&gt;

&lt;P&gt;I have started with following rex command, but I cannot look for the text till "owned by" and for user name "owned by" to "on" and so on&lt;/P&gt;

&lt;P&gt;| rex Message="(?[^\,]&lt;EM&gt;)\,(?[(&lt;/EM&gt;)?:owned]*)"  | table DocumentNum DocumentType&lt;/P&gt;

&lt;P&gt;my result is looking like this:   DocumentNum    = Document 345&lt;BR /&gt;
                                                       DocumentType =   Micro         &lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2015 13:54:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165076#M46882</guid>
      <dc:creator>sabithanitg</dc:creator>
      <dc:date>2015-04-24T13:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: rex command to extract fields from field( Message=Document 345, Microsoft Word Text **owned by** first.last **on** abc1234 **was** some text **on** some text.............)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165077#M46883</link>
      <description>&lt;P&gt;Hello! Here you go&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex "^Message=(?P&amp;lt;DocumentNum&amp;gt;[^,]+),\s+(?P&amp;lt;DocumentType&amp;gt;\w+\s+\w+\s+\w+)(?:[^ \n]* ){3}(?P&amp;lt;username&amp;gt;[^ ]+) on (?P&amp;lt;device&amp;gt;[a-f0-9]+) was (?P&amp;lt;location&amp;gt;.+)"|table  DocumentNum,DocumentType, username, device, location
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Apr 2015 14:28:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165077#M46883</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-04-24T14:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: rex command to extract fields from field( Message=Document 345, Microsoft Word Text **owned by** first.last **on** abc1234 **was** some text **on** some text.............)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165078#M46884</link>
      <description>&lt;P&gt;Thanks for the answer Stephane, This is not showing up any value for these fields. Is there any other method to achieve this?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2015 14:53:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165078#M46884</guid>
      <dc:creator>sabithanitg</dc:creator>
      <dc:date>2015-04-24T14:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: rex command to extract fields from field( Message=Document 345, Microsoft Word Text **owned by** first.last **on** abc1234 **was** some text **on** some text.............)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165079#M46885</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    ..........|rex "^Message=(?P&amp;lt;DocumentNum&amp;gt;[^,]+),\s+(?P&amp;lt;DocumentType&amp;gt;\w+\s+\w+\s+\w+)\sowned\sby\s(?P&amp;lt;username&amp;gt;[^ ]+)\son\s(?P&amp;lt;device&amp;gt;[a-f0-9]+)\swas\s(?P&amp;lt;location&amp;gt;.+)"|table  DocumentNum,DocumentType, username, device, location
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And if you are working with a &lt;STRONG&gt;csv file&lt;/STRONG&gt;, means &lt;STRONG&gt;Message&lt;/STRONG&gt; is a field in your csv, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;       ..........|rex field=Message "(?P&amp;lt;DocumentNum&amp;gt;[^,]+),\s+(?P&amp;lt;DocumentType&amp;gt;\w+\s+\w+\s+\w+)\sowned\sby\s(?P&amp;lt;username&amp;gt;[^ ]+)\son\s(?P&amp;lt;device&amp;gt;[a-f0-9]+)\swas\s(?P&amp;lt;location&amp;gt;.+)"|table  DocumentNum,DocumentType, username, device, location
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if not working also, please let me see  the entire first line of your events.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2015 15:04:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165079#M46885</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-04-24T15:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: rex command to extract fields from field( Message=Document 345, Microsoft Word Text **owned by** first.last **on** abc1234 **was** some text **on** some text.............)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165080#M46886</link>
      <description>&lt;P&gt;Thanks stephane, With few changes it is working to extract for few values not all of them.&lt;BR /&gt;
Is there any possibility of extracting all.&lt;/P&gt;

&lt;P&gt;For example DocumentType field value contains as below similarly for Location &lt;BR /&gt;
Microsoft Outlook - Memo Style,&lt;BR /&gt;
11-02-099.pdf,&lt;BR /&gt;
&lt;A href="https://h44444.www3.hp.com/HPCSN/EtFOnline/fff_ff_notes"&gt;https://h44444.www3.hp.com/HPCSN/EtFOnline/fff_ff_notes&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2015 17:34:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165080#M46886</guid>
      <dc:creator>sabithanitg</dc:creator>
      <dc:date>2015-04-24T17:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: rex command to extract fields from field( Message=Document 345, Microsoft Word Text **owned by** first.last **on** abc1234 **was** some text **on** some text.............)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165081#M46887</link>
      <description>&lt;P&gt;yes of course! there are many possibilities to extract what you want.  Please which of the above queries worked?&lt;BR /&gt;
If it is the first one, here you go now:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex  "^Message=(?P&amp;lt;DocumentNum&amp;gt;[^,]+),(?P&amp;lt;DocumentType&amp;gt;[^\n]*)owned\sby\s(?P&amp;lt;username&amp;gt;[^ ]+)\s+on\s+(?P&amp;lt;device&amp;gt;[a-f0-9]+)\s+was\s+(?P&amp;lt;location&amp;gt;[^\n]*)"|table DocumentNum DocumentType, username ,device, location
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if it is the second one, here you go&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=Message "(?P&amp;lt;DocumentNum&amp;gt;[^,]+),(?P&amp;lt;DocumentType&amp;gt;[^\n]*)owned\sby\s(?P&amp;lt;username&amp;gt;[^ ]+)\s+on\s+(?P&amp;lt;device&amp;gt;[a-f0-9]+)\s+was\s+(?P&amp;lt;location&amp;gt;[^\n]*)"|table DocumentNum DocumentType, username ,device, location
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope it may help now.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2015 20:20:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165081#M46887</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-04-24T20:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: rex command to extract fields from field( Message=Document 345, Microsoft Word Text **owned by** first.last **on** abc1234 **was** some text **on** some text.............)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165082#M46888</link>
      <description>&lt;P&gt;I am using the first one.It worked perfectly.&lt;BR /&gt;
 Thank you very much and appreciate your help. &lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2015 04:06:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-command-to-extract-fields-from-field-Message-Document-345/m-p/165082#M46888</guid>
      <dc:creator>sabithanitg</dc:creator>
      <dc:date>2015-04-26T04:06:37Z</dc:date>
    </item>
  </channel>
</rss>

