<?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: Newbie Splunk Field Extraction Question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Newbie-Splunk-Field-Extraction-Question/m-p/90665#M23286</link>
    <description>&lt;P&gt;You can make that a permanent field extraction by selecting the specific event and building the extraction with the extract fields from the pull down next to each log line or you can:&lt;/P&gt;

&lt;P&gt;create a props.conf for that sourcetype and in it put this in it:&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
[YOURSOURCETYPE]&lt;BR /&gt;
EXTRACT-myextraction = order:\s(?&lt;NETSALES&gt;\d+.?\d+)&lt;/NETSALES&gt;&lt;/P&gt;

&lt;P&gt;Or&lt;/P&gt;

&lt;P&gt;create a props.conf and a transforms.conf&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
[YOURSOURCETYPE]&lt;BR /&gt;
REPORT-myextraction = myfieldextraction&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
[myfieldextraction]&lt;BR /&gt;
REGEX = order:\s(?&lt;NETSALES&gt;\d+.?\d+)&lt;/NETSALES&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Oct 2012 20:46:49 GMT</pubDate>
    <dc:creator>dmaislin_splunk</dc:creator>
    <dc:date>2012-10-15T20:46:49Z</dc:date>
    <item>
      <title>Newbie Splunk Field Extraction Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Newbie-Splunk-Field-Extraction-Question/m-p/90663#M23284</link>
      <description>&lt;P&gt;I have a log entry that looks like this.  I am talked with coming up with a quick-and-dirty financial report to report net sales.  Can someone tell me where to start doing this?  Do I build a report and use field extraction?  The values I want to look for are, or course, "Net Sales", and then capture the dollar amound after that.  I would like to just get a list of the &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ThreadName=Thread-2;|12:26:21,680  INFO OrderController:126 - Net sales per order: 362.15
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Oct 2012 18:23:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Newbie-Splunk-Field-Extraction-Question/m-p/90663#M23284</guid>
      <dc:creator>jcman01</dc:creator>
      <dc:date>2012-10-15T18:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie Splunk Field Extraction Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Newbie-Splunk-Field-Extraction-Question/m-p/90664#M23285</link>
      <description>&lt;P&gt;The easiest way to extract that field will be to use the rex command in search. This should give you what you want:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yoursearch&amp;gt; | rex field=_raw "order:\s(?&amp;lt;netsales&amp;gt;\d+.?\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That should extract that dollar amount into a field called netsales. This is assuming that the dollar amount is always preceded by order: &lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 18:38:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Newbie-Splunk-Field-Extraction-Question/m-p/90664#M23285</guid>
      <dc:creator>RicoSuave</dc:creator>
      <dc:date>2012-10-15T18:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie Splunk Field Extraction Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Newbie-Splunk-Field-Extraction-Question/m-p/90665#M23286</link>
      <description>&lt;P&gt;You can make that a permanent field extraction by selecting the specific event and building the extraction with the extract fields from the pull down next to each log line or you can:&lt;/P&gt;

&lt;P&gt;create a props.conf for that sourcetype and in it put this in it:&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
[YOURSOURCETYPE]&lt;BR /&gt;
EXTRACT-myextraction = order:\s(?&lt;NETSALES&gt;\d+.?\d+)&lt;/NETSALES&gt;&lt;/P&gt;

&lt;P&gt;Or&lt;/P&gt;

&lt;P&gt;create a props.conf and a transforms.conf&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
[YOURSOURCETYPE]&lt;BR /&gt;
REPORT-myextraction = myfieldextraction&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
[myfieldextraction]&lt;BR /&gt;
REGEX = order:\s(?&lt;NETSALES&gt;\d+.?\d+)&lt;/NETSALES&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 20:46:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Newbie-Splunk-Field-Extraction-Question/m-p/90665#M23286</guid>
      <dc:creator>dmaislin_splunk</dc:creator>
      <dc:date>2012-10-15T20:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie Splunk Field Extraction Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Newbie-Splunk-Field-Extraction-Question/m-p/90666#M23287</link>
      <description>&lt;P&gt;This usually works. However, it wouldn't extract anything with an input like &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
ThreadName=Thread-2;|12:26:21,680  INFO OrderController:126 - Net sales per order: 3
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;since the regex asks for at least two digits. Also, you need to escape the point. Maybe something like this would be better:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;YOURSEARCH&gt; | rex field=_raw "order:\s+(?&lt;NETSALES&gt;\d+(?:\.\d+)?)"
&lt;/NETSALES&gt;&lt;/YOURSEARCH&gt;&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This allows for an arbitrary number (&amp;gt;0) of whitespaces.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 10:44:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Newbie-Splunk-Field-Extraction-Question/m-p/90666#M23287</guid>
      <dc:creator>ptanner</dc:creator>
      <dc:date>2012-10-16T10:44:03Z</dc:date>
    </item>
  </channel>
</rss>

