<?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: Field Extraction in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction/m-p/82375#M17049</link>
    <description>&lt;P&gt;Sorry, I am not sure I know what you are saying. I did put the CSV in as a file input. I thought that the Field Extraction process would create a delimeter? Am I wrong?&lt;/P&gt;</description>
    <pubDate>Fri, 04 Oct 2013 01:52:58 GMT</pubDate>
    <dc:creator>gjohnson</dc:creator>
    <dc:date>2013-10-04T01:52:58Z</dc:date>
    <item>
      <title>Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction/m-p/82373#M17047</link>
      <description>&lt;P&gt;I am trying to extract a field from the following lines but the field extraction does not result in a Field. The sample data is a CSV download from a credit card site:&lt;/P&gt;

&lt;P&gt;02/14/2013  Thu,,"PIZZA HUT # 023603 0MC LEAN             VA                  ","GEORGE T JOHNSON","XXXX-XXXXXX-82003",,,28.75,,,,,,,&lt;BR /&gt;
02/15/2013  Fri,,"BONSAI GRILL 1234560ARLINGTON           VA                  ","GEORGE T JOHNSON","XXXX-XXXXXX-82003",,,32.21,,,,,,,&lt;BR /&gt;
02/15/2013  Fri,,"EXXONMOBIL          MCLEAN              VA                  ","GEORGE T JOHNSON","XXXX-XXXXXX-82003",,,57.28,,,,,,,&lt;/P&gt;

&lt;P&gt;The field I am looking for has the values of "28.75, 32.21, 57.28" values. I did an automated field extract by copying out the value, putting it in the sample and generating a regex - it successfully identifies the information I want (it is highlighted). I hit save then go back to searching, but the field doesn't extract. &lt;/P&gt;

&lt;P&gt;I then tried copying the rex pattern that successfully identified the fields in the auto-generator (see the rex below) and I ran it right on the search bar - but it brought back a sparse return (there wasn't a price field for every line like there should be).&lt;/P&gt;

&lt;P&gt;running this yields inconsistent results &lt;BR /&gt;
... | rex "(?i)^(?:[^\-]*\-){3}\d+\",,,(?P&lt;PRICE&gt;[^,]+)"&lt;/PRICE&gt;&lt;/P&gt;

&lt;P&gt;Can anyone help me with the right regex for a field extraction that yields a "price" for every line in the file?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2013 01:34:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction/m-p/82373#M17047</guid>
      <dc:creator>gjohnson</dc:creator>
      <dc:date>2013-10-04T01:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction/m-p/82374#M17048</link>
      <description>&lt;P&gt;Hi gjohnson,&lt;BR /&gt;
why you are not putting that csv in inputs.conf, defining a TRANSFORM in props.conf, defining a field DELIM on your transforms.conf and the assign the right field to the different column?&lt;/P&gt;

&lt;P&gt;ciao&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2013 01:42:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction/m-p/82374#M17048</guid>
      <dc:creator>bizza</dc:creator>
      <dc:date>2013-10-04T01:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction/m-p/82375#M17049</link>
      <description>&lt;P&gt;Sorry, I am not sure I know what you are saying. I did put the CSV in as a file input. I thought that the Field Extraction process would create a delimeter? Am I wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2013 01:52:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction/m-p/82375#M17049</guid>
      <dc:creator>gjohnson</dc:creator>
      <dc:date>2013-10-04T01:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction/m-p/82376#M17050</link>
      <description>&lt;P&gt;something like this&lt;/P&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;P&gt;[monitor:///path/to/file.csv]&lt;BR /&gt;
sourcetype = yoursourcetype &lt;BR /&gt;
disabled = 0&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;P&gt;[sourcetype::yoursourcetype]&lt;BR /&gt;
CHECK__FOR _HEADER=TRUE&lt;BR /&gt;
SHOULD _LINEMERGE = false&lt;BR /&gt;
TRANSFORM-transformfile = transf_csv&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;P&gt;[transf_csv]&lt;BR /&gt;
DELIMS=","&lt;BR /&gt;
FIELDS="field1", "field2", "field3", "field4", "fieldN"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:53:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction/m-p/82376#M17050</guid>
      <dc:creator>bizza</dc:creator>
      <dc:date>2020-09-28T14:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction/m-p/82377#M17051</link>
      <description>&lt;P&gt;Could  you please try below rex.&lt;/P&gt;

&lt;P&gt;"(?i)^(?:[^,]*,){7}(?P&lt;PRICE&gt;[^,]+)"&lt;/PRICE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2013 10:32:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Extraction/m-p/82377#M17051</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-10-04T10:32:06Z</dc:date>
    </item>
  </channel>
</rss>

