<?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: How to edit my regex to extract this value from my data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278523#M84092</link>
    <description>&lt;P&gt;Hi javiergn, I am only able to extract doesn. Could you explain you code too?&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 07 Apr 2016 20:10:22 GMT</pubDate>
    <dc:creator>ibekacyril</dc:creator>
    <dc:date>2016-04-07T20:10:22Z</dc:date>
    <item>
      <title>How to edit my regex to extract this value from my data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278521#M84090</link>
      <description>&lt;P&gt;This should be an easy thing to do but obviously, I am missing it. I need to extract "cannot be located"&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;c.f.a.k.m.SessionDaoImpl - The owner with id:   s3498-34ef-034456d-c65a5678-fcd4-11e5-a5d4f cannot be located&lt;BR /&gt;&lt;BR /&gt;
[2016-04-07 15:41:44,760]​&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Here is my code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my search | rex  "c\.f\.a\.k\.m\.SessionDaoImpl\s\-\sThe\sowner\swith\sid:\s[\w+\d+]\s(?&amp;lt;captureThis&amp;gt;\w+)"\[
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 18:54:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278521#M84090</guid>
      <dc:creator>ibekacyril</dc:creator>
      <dc:date>2016-04-07T18:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regex to extract this value from my data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278522#M84091</link>
      <description>&lt;P&gt;Try this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my search 
| rex "(?msi):\s+[\w\-]+\s+(?&amp;lt;message&amp;gt;[\w\s]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then use the message variable as you wish.&lt;/P&gt;

&lt;P&gt;EDIT to include code description as requested:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?msi) --&amp;gt; support for multiline, "single line mode" makes the dot match all characters including line breaks, case insensitive
:\s+ --&amp;gt; find a colon followed by multiple blank spaces
[\w\-]+\s+ --&amp;gt; Look for 1 or more alphanumerical characters or hyphens followed by 1 or more blanks
(?&amp;lt;message&amp;gt;[\w\s]+) --&amp;gt; capture in the token message 1 or more alphanumerical or blank space characters
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Apr 2016 19:12:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278522#M84091</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-04-07T19:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regex to extract this value from my data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278523#M84092</link>
      <description>&lt;P&gt;Hi javiergn, I am only able to extract doesn. Could you explain you code too?&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 20:10:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278523#M84092</guid>
      <dc:creator>ibekacyril</dc:creator>
      <dc:date>2016-04-07T20:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regex to extract this value from my data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278524#M84093</link>
      <description>&lt;P&gt;Just tweaked it and got "doesn't exist" by adding \'. How can I tweak it to get:&lt;BR /&gt;
The owner with id doesn't exist&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 20:14:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278524#M84093</guid>
      <dc:creator>ibekacyril</dc:creator>
      <dc:date>2016-04-07T20:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regex to extract this value from my data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278525#M84094</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm not sure what you mean. For instance, if I run the following in order to replicate your logs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count
| eval _raw ="c.f.a.k.m.SessionDaoImpl - The owner with id: s3498-34ef-034456d-c65a5678-fcd4-11e5-a5d4f cannot be located [2016-04-07 15:41:44,760]​"
| rex "(?msi):\s+[\w\-]+\s+(?&amp;lt;message&amp;gt;[\w\s]+)"
| table message
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get the output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;message
cannot be located 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Isn't that what you are trying to achieve?&lt;BR /&gt;
If not, can you post your whole query here so that we can investigate a bit more?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
J&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 20:34:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278525#M84094</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-04-07T20:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regex to extract this value from my data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278526#M84095</link>
      <description>&lt;P&gt;Hi J, I finally got it working. Thanks, it was my mistake&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 14:39:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278526#M84095</guid>
      <dc:creator>ibekacyril</dc:creator>
      <dc:date>2016-04-08T14:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regex to extract this value from my data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278527#M84096</link>
      <description>&lt;P&gt;Hi J, is there a way of combining two rex searches together say the first one like above and then I have this second rex "[Status] .+? - (?.+)" | code that combines message and output into one name (outMessage)&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 15:15:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278527#M84096</guid>
      <dc:creator>ibekacyril</dc:creator>
      <dc:date>2016-04-08T15:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my regex to extract this value from my data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278528#M84097</link>
      <description>&lt;P&gt;You could do something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search here
| rex "(?msi):\s+[\w\-]+\s+(?&amp;lt;message&amp;gt;[\w\s]+)"
| rex "\[Status\] .+?\-(?&amp;lt;output&amp;gt;.+)"
| eval outMessage = message + output
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Careful with your regex by the way. If you don't escape the special characters it won't work as expected.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2016 12:59:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-regex-to-extract-this-value-from-my-data/m-p/278528#M84097</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-04-09T12:59:09Z</dc:date>
    </item>
  </channel>
</rss>

