<?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 How to rex field in unstructured flat file events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-in-unstructured-flat-file-events/m-p/462219#M130279</link>
    <description>&lt;P&gt;I am breaking every line in flat file and trying to fetch the field using rex, this is how my events looks like: &lt;/P&gt;

&lt;P&gt;98000020200512            &lt;STRONG&gt;-992.00&lt;/STRONG&gt;               0.00 001 01&lt;BR /&gt;
98000020200523          &lt;STRONG&gt;830566.00&lt;/STRONG&gt;            0.00 001 02&lt;BR /&gt;
98000020200515           &lt;STRONG&gt;-7356.00&lt;/STRONG&gt;              0.00 001 03&lt;BR /&gt;
98000020200516          &lt;STRONG&gt;-18760.00&lt;/STRONG&gt;             0.00 001 04&lt;BR /&gt;
98000020200518          &lt;STRONG&gt;764074.00&lt;/STRONG&gt;            0.00 001 05&lt;BR /&gt;
98000020200530          &lt;STRONG&gt;165432.00&lt;/STRONG&gt;            0.00 001 06&lt;BR /&gt;
98000020200531           &lt;STRONG&gt;98715.00&lt;/STRONG&gt;             0.00 001 07&lt;BR /&gt;
98000020200511          &lt;STRONG&gt;119993.00&lt;/STRONG&gt;            0.00 001 08&lt;BR /&gt;
98000020200502          &lt;STRONG&gt;908831.00&lt;/STRONG&gt;            0.00 001 09&lt;BR /&gt;
12000020200507           &lt;STRONG&gt;-5481.00&lt;/STRONG&gt;               0.00 001 10&lt;/P&gt;

&lt;P&gt;The bold digits need to be extracted as Amount field, where the values could be a negative or positive amount.&lt;/P&gt;</description>
    <pubDate>Tue, 26 May 2020 10:37:05 GMT</pubDate>
    <dc:creator>jhantuSplunk</dc:creator>
    <dc:date>2020-05-26T10:37:05Z</dc:date>
    <item>
      <title>How to rex field in unstructured flat file events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-in-unstructured-flat-file-events/m-p/462219#M130279</link>
      <description>&lt;P&gt;I am breaking every line in flat file and trying to fetch the field using rex, this is how my events looks like: &lt;/P&gt;

&lt;P&gt;98000020200512            &lt;STRONG&gt;-992.00&lt;/STRONG&gt;               0.00 001 01&lt;BR /&gt;
98000020200523          &lt;STRONG&gt;830566.00&lt;/STRONG&gt;            0.00 001 02&lt;BR /&gt;
98000020200515           &lt;STRONG&gt;-7356.00&lt;/STRONG&gt;              0.00 001 03&lt;BR /&gt;
98000020200516          &lt;STRONG&gt;-18760.00&lt;/STRONG&gt;             0.00 001 04&lt;BR /&gt;
98000020200518          &lt;STRONG&gt;764074.00&lt;/STRONG&gt;            0.00 001 05&lt;BR /&gt;
98000020200530          &lt;STRONG&gt;165432.00&lt;/STRONG&gt;            0.00 001 06&lt;BR /&gt;
98000020200531           &lt;STRONG&gt;98715.00&lt;/STRONG&gt;             0.00 001 07&lt;BR /&gt;
98000020200511          &lt;STRONG&gt;119993.00&lt;/STRONG&gt;            0.00 001 08&lt;BR /&gt;
98000020200502          &lt;STRONG&gt;908831.00&lt;/STRONG&gt;            0.00 001 09&lt;BR /&gt;
12000020200507           &lt;STRONG&gt;-5481.00&lt;/STRONG&gt;               0.00 001 10&lt;/P&gt;

&lt;P&gt;The bold digits need to be extracted as Amount field, where the values could be a negative or positive amount.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 10:37:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-in-unstructured-flat-file-events/m-p/462219#M130279</guid>
      <dc:creator>jhantuSplunk</dc:creator>
      <dc:date>2020-05-26T10:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to rex field in unstructured flat file events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-in-unstructured-flat-file-events/m-p/462220#M130280</link>
      <description>&lt;P&gt;Hi @jhantuSplunk,&lt;BR /&gt;
try this regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^\d+\s+(?&amp;lt;Amount&amp;gt;[^ ]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that you can test at &lt;A href="https://regex101.com/r/F24fG0/1"&gt;https://regex101.com/r/F24fG0/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 16:21:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-in-unstructured-flat-file-events/m-p/462220#M130280</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-05-26T16:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to rex field in unstructured flat file events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-in-unstructured-flat-file-events/m-p/462221#M130281</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval temp="98000020200512 -992.00 0.00 001 01,
98000020200523 830566.00 0.00 001 02,
98000020200515 -7356.00 0.00 001 03,
98000020200516 -18760.00 0.00 001 04,
98000020200518 764074.00 0.00 001 05,
98000020200530 165432.00 0.00 001 06,
98000020200531 98715.00 0.00 001 07,
98000020200511 119993.00 0.00 001 08,
98000020200502 908831.00 0.00 001 09,
12000020200507 -5481.00 0.00 001 10" 
| makemv delim="," temp 
| mvexpand temp 
| eval result= mvindex(split(temp," "),1) 
| table result
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 May 2020 02:46:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-in-unstructured-flat-file-events/m-p/462221#M130281</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-05-27T02:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to rex field in unstructured flat file events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-in-unstructured-flat-file-events/m-p/462222#M130282</link>
      <description>&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = \d{6}
TIME_FORMAT = %Y%m%d
SHOULD_LINEMERGE = false
EXTRACT-unst = ^\d+\s+(?&amp;lt;Amount&amp;gt;[^ ]+)\s+(?&amp;lt;fieldA&amp;gt;[^ ]+)\s+(?&amp;lt;fieldB&amp;gt;[^ ]+)\s+(?&amp;lt;fieldC&amp;gt;[^ ]+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 May 2020 08:26:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-in-unstructured-flat-file-events/m-p/462222#M130282</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-27T08:26:23Z</dc:date>
    </item>
  </channel>
</rss>

