<?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 Extract raw data using rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-raw-data-using-rex/m-p/65613#M16296</link>
    <description>&lt;P&gt;I want to extract exception, key and message from a raw event in our logs. The event looks like:&lt;/P&gt;

&lt;P&gt;EXCEPTION -  : TypeOfException : keyprefix.keyName : Message from web service&lt;/P&gt;

&lt;P&gt;From the event I use REX to get the following:&lt;/P&gt;

&lt;P&gt;exception=TypeOfException &lt;BR /&gt;
key=keyprefix.keyName&lt;BR /&gt;
message=Message from web service&lt;/P&gt;

&lt;P&gt;I am using the following rex for it:&lt;/P&gt;

&lt;P&gt;rex field=_raw "EXCEPTION -  : (?&lt;EXCEPTION&gt;\w+) : (?&lt;KEY&gt;\w+) : (?&lt;MESSAGE&gt;\w+)"&lt;/MESSAGE&gt;&lt;/KEY&gt;&lt;/EXCEPTION&gt;&lt;/P&gt;

&lt;P&gt;But this isn't working. Can you guys point me in the right direction?&lt;BR /&gt;
I have tried various combinations of these inserting spaces (\s) where we see spaces in the event.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Sep 2012 00:06:52 GMT</pubDate>
    <dc:creator>ninadmnaik</dc:creator>
    <dc:date>2012-09-20T00:06:52Z</dc:date>
    <item>
      <title>Extract raw data using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-raw-data-using-rex/m-p/65613#M16296</link>
      <description>&lt;P&gt;I want to extract exception, key and message from a raw event in our logs. The event looks like:&lt;/P&gt;

&lt;P&gt;EXCEPTION -  : TypeOfException : keyprefix.keyName : Message from web service&lt;/P&gt;

&lt;P&gt;From the event I use REX to get the following:&lt;/P&gt;

&lt;P&gt;exception=TypeOfException &lt;BR /&gt;
key=keyprefix.keyName&lt;BR /&gt;
message=Message from web service&lt;/P&gt;

&lt;P&gt;I am using the following rex for it:&lt;/P&gt;

&lt;P&gt;rex field=_raw "EXCEPTION -  : (?&lt;EXCEPTION&gt;\w+) : (?&lt;KEY&gt;\w+) : (?&lt;MESSAGE&gt;\w+)"&lt;/MESSAGE&gt;&lt;/KEY&gt;&lt;/EXCEPTION&gt;&lt;/P&gt;

&lt;P&gt;But this isn't working. Can you guys point me in the right direction?&lt;BR /&gt;
I have tried various combinations of these inserting spaces (\s) where we see spaces in the event.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2012 00:06:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-raw-data-using-rex/m-p/65613#M16296</guid>
      <dc:creator>ninadmnaik</dc:creator>
      <dc:date>2012-09-20T00:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extract raw data using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-raw-data-using-rex/m-p/65614#M16297</link>
      <description>&lt;P&gt;Ok. Found the answer:&lt;BR /&gt;
rex field=_raw "EXCEPTION\s-\s\s:(?&lt;EXCEPTION&gt;[\s\w]+): (?&lt;KEY&gt;\w+.\w+) : (?&lt;MESSAGE&gt;[\w\s]+)"&lt;/MESSAGE&gt;&lt;/KEY&gt;&lt;/EXCEPTION&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2012 00:25:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-raw-data-using-rex/m-p/65614#M16297</guid>
      <dc:creator>ninadmnaik</dc:creator>
      <dc:date>2012-09-20T00:25:00Z</dc:date>
    </item>
  </channel>
</rss>

