<?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 apply regex rules in props.conf and transforms.conf to filter unstructured data before indexing it in Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-regex-rules-in-props-conf-and-transforms-conf-to/m-p/235807#M70025</link>
    <description>&lt;P&gt;The requirement is a multilevel filter&lt;BR /&gt;
 1. I need to create a line break at &lt;CODE&gt;Header|521|02|00|521|&lt;/CODE&gt; which I am doing using props.conf &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;BREAK_ONLY_BEFORE = Header\|\S*\|\S*\|\S*\|521\|
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;I need to extract a number of fields using transforms.conf&lt;BR /&gt;
&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;REGEX = (?P&lt;F1&gt;[^|]&lt;EM&gt;)|(?P&lt;F2&gt;[^|]&lt;/F2&gt;&lt;/EM&gt;)|(?P&lt;F3&gt;[^|]&lt;EM&gt;)|(?P&lt;F4&gt;[^|]&lt;/F4&gt;&lt;/EM&gt;)|(?P&lt;F5&gt;[^|]&lt;EM&gt;)|(?P&lt;F6&gt;[^|]&lt;/F6&gt;&lt;/EM&gt;)|(?P&lt;F7&gt;[^|]*)&lt;/F7&gt;&lt;/F5&gt;&lt;/F3&gt;&lt;/F1&gt;&lt;/P&gt;

&lt;P&gt;DEST_KEY = _raw&lt;BR /&gt;
FORMAT = $1,$7&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;I Also need to filter the event with a specific value in field such as f7=SCL&lt;BR /&gt;
Log file looks like as below &lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;****&lt;STRONG&gt;&lt;EM&gt;log file *&lt;/EM&gt;&lt;/STRONG&gt;*&lt;BR /&gt;
512  521  1054      14447916361    SCL@YOK   384  P          2&amp;#15; 10GNS@GOC   &lt;STRONG&gt;Header|521|02|00|521|&lt;/STRONG&gt;|SCL@YOK||scl11adm|TYO|NRT|2015-10-14 12:00:33+09:00|2015-10-14 12:00:36+09:00|2015-10-14 11:00:36+08:00|&lt;BR /&gt;
Identifier 3235897206|&lt;BR /&gt;
Detail YOK|AHG|SYD|SSE|2015-10-14 11:59:00+09:00|YA4VC|P|P|82.000|0.000||&lt;BR /&gt;
Reference F7P43||||1|I|&lt;BR /&gt;
PieceDetail JD014600000733002464|82.0|||178.6|||58.0|||110.0|||140.0||||WPX||||&lt;BR /&gt;
ExtraCharge YW|JP||0.000||JPY|FOCJPBBX||2015-10-14 11:59:00+09:00||I|&lt;BR /&gt;
Document|3235897206||FCA||||||||||&lt;BR /&gt;
DocumentLine 3235897206||1|||||||JP|P|1||0.000||BREAK BULK EXPRESS|KGS.|AUD||&lt;BR /&gt;
512  15206781       14447916361    SCL@TYO   384  P          2&amp;#15; 10GNS2@GOC  &lt;STRONG&gt;Header|15206|02|00|521|&lt;/STRONG&gt;|SCL@TYO||scl11adm|TYO|---|2015-10-14 12:00:36+09:00|2015-10-14 12:00:36+09:00|2015-10-14 11:00:36+08:00|&lt;BR /&gt;
Identifier 9929275941|&lt;BR /&gt;
Detail TYO||LBA|SHF|2015-10-14 10:59:00+09:00|NEW0|D|D|0.50|0.40||K|A|DOCUMENT|DOX|0.000|&lt;BR /&gt;
PieceDetail JD014600002447636977|0.5||||||1.0|||48.0|||39.0||||||||&lt;BR /&gt;
512  518  246       14447915821    GOP@PEK   384  PKUL       2&amp;#15; 10GNS2@GOC&lt;BR /&gt;&lt;BR /&gt;
Header||02|00|518||GOP|GOP@PEK||PEK|WOC|2015-10-14 10:59:00+08:00|2015-10-14 10:59:00+08:00||&lt;BR /&gt;
EventCommon P|JD014600001332139235|||2015-10-14 10:59:00+08:00|PEK|WOC|PEK|PEK|000001|OK||&amp;lt;lhj&amp;gt;|d|&lt;BR /&gt;
EventSpecific 7329|WOZA|A|||&amp;lt;lhj&amp;gt;|&lt;BR /&gt;
512  518  246       14447915871    GOP@PEK   384  PKUL       2&amp;#15; 10GNS2@GOC  Header||02|00|518||GOP|GOP@PEK||PEK|WOC|2015-10-14 10:59:00+08:00|2015-10-14 10:59:00+08:00||&lt;BR /&gt;
EventCommon P|JD013059718270005069|||2015-10-14 10:59:00+08:00|PEK|WOC|PEK|PEK|000001|OK||&amp;lt;lhj&amp;gt;|d|&lt;BR /&gt;
EventSpecific7329|WOZA|A|||&amp;lt;lhj&amp;gt;|&lt;BR /&gt;
512  518  246       14447915931    GOP@PEK   384  PKUL       2&amp;#15; 10GNS2@GOC&lt;BR /&gt;&lt;BR /&gt;
&lt;STRONG&gt;Header&lt;/STRONG&gt;||02|00|518||GOP|GOP@PEK||PEK|WOC|2015-10-14 10:59:00+08:00|2015-10-14 10:59:00+08:00||&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jan 2016 03:47:49 GMT</pubDate>
    <dc:creator>prachisaxena</dc:creator>
    <dc:date>2016-01-19T03:47:49Z</dc:date>
    <item>
      <title>How to apply regex rules in props.conf and transforms.conf to filter unstructured data before indexing it in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-regex-rules-in-props-conf-and-transforms-conf-to/m-p/235807#M70025</link>
      <description>&lt;P&gt;The requirement is a multilevel filter&lt;BR /&gt;
 1. I need to create a line break at &lt;CODE&gt;Header|521|02|00|521|&lt;/CODE&gt; which I am doing using props.conf &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;BREAK_ONLY_BEFORE = Header\|\S*\|\S*\|\S*\|521\|
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;I need to extract a number of fields using transforms.conf&lt;BR /&gt;
&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;REGEX = (?P&lt;F1&gt;[^|]&lt;EM&gt;)|(?P&lt;F2&gt;[^|]&lt;/F2&gt;&lt;/EM&gt;)|(?P&lt;F3&gt;[^|]&lt;EM&gt;)|(?P&lt;F4&gt;[^|]&lt;/F4&gt;&lt;/EM&gt;)|(?P&lt;F5&gt;[^|]&lt;EM&gt;)|(?P&lt;F6&gt;[^|]&lt;/F6&gt;&lt;/EM&gt;)|(?P&lt;F7&gt;[^|]*)&lt;/F7&gt;&lt;/F5&gt;&lt;/F3&gt;&lt;/F1&gt;&lt;/P&gt;

&lt;P&gt;DEST_KEY = _raw&lt;BR /&gt;
FORMAT = $1,$7&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;I Also need to filter the event with a specific value in field such as f7=SCL&lt;BR /&gt;
Log file looks like as below &lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;****&lt;STRONG&gt;&lt;EM&gt;log file *&lt;/EM&gt;&lt;/STRONG&gt;*&lt;BR /&gt;
512  521  1054      14447916361    SCL@YOK   384  P          2&amp;#15; 10GNS@GOC   &lt;STRONG&gt;Header|521|02|00|521|&lt;/STRONG&gt;|SCL@YOK||scl11adm|TYO|NRT|2015-10-14 12:00:33+09:00|2015-10-14 12:00:36+09:00|2015-10-14 11:00:36+08:00|&lt;BR /&gt;
Identifier 3235897206|&lt;BR /&gt;
Detail YOK|AHG|SYD|SSE|2015-10-14 11:59:00+09:00|YA4VC|P|P|82.000|0.000||&lt;BR /&gt;
Reference F7P43||||1|I|&lt;BR /&gt;
PieceDetail JD014600000733002464|82.0|||178.6|||58.0|||110.0|||140.0||||WPX||||&lt;BR /&gt;
ExtraCharge YW|JP||0.000||JPY|FOCJPBBX||2015-10-14 11:59:00+09:00||I|&lt;BR /&gt;
Document|3235897206||FCA||||||||||&lt;BR /&gt;
DocumentLine 3235897206||1|||||||JP|P|1||0.000||BREAK BULK EXPRESS|KGS.|AUD||&lt;BR /&gt;
512  15206781       14447916361    SCL@TYO   384  P          2&amp;#15; 10GNS2@GOC  &lt;STRONG&gt;Header|15206|02|00|521|&lt;/STRONG&gt;|SCL@TYO||scl11adm|TYO|---|2015-10-14 12:00:36+09:00|2015-10-14 12:00:36+09:00|2015-10-14 11:00:36+08:00|&lt;BR /&gt;
Identifier 9929275941|&lt;BR /&gt;
Detail TYO||LBA|SHF|2015-10-14 10:59:00+09:00|NEW0|D|D|0.50|0.40||K|A|DOCUMENT|DOX|0.000|&lt;BR /&gt;
PieceDetail JD014600002447636977|0.5||||||1.0|||48.0|||39.0||||||||&lt;BR /&gt;
512  518  246       14447915821    GOP@PEK   384  PKUL       2&amp;#15; 10GNS2@GOC&lt;BR /&gt;&lt;BR /&gt;
Header||02|00|518||GOP|GOP@PEK||PEK|WOC|2015-10-14 10:59:00+08:00|2015-10-14 10:59:00+08:00||&lt;BR /&gt;
EventCommon P|JD014600001332139235|||2015-10-14 10:59:00+08:00|PEK|WOC|PEK|PEK|000001|OK||&amp;lt;lhj&amp;gt;|d|&lt;BR /&gt;
EventSpecific 7329|WOZA|A|||&amp;lt;lhj&amp;gt;|&lt;BR /&gt;
512  518  246       14447915871    GOP@PEK   384  PKUL       2&amp;#15; 10GNS2@GOC  Header||02|00|518||GOP|GOP@PEK||PEK|WOC|2015-10-14 10:59:00+08:00|2015-10-14 10:59:00+08:00||&lt;BR /&gt;
EventCommon P|JD013059718270005069|||2015-10-14 10:59:00+08:00|PEK|WOC|PEK|PEK|000001|OK||&amp;lt;lhj&amp;gt;|d|&lt;BR /&gt;
EventSpecific7329|WOZA|A|||&amp;lt;lhj&amp;gt;|&lt;BR /&gt;
512  518  246       14447915931    GOP@PEK   384  PKUL       2&amp;#15; 10GNS2@GOC&lt;BR /&gt;&lt;BR /&gt;
&lt;STRONG&gt;Header&lt;/STRONG&gt;||02|00|518||GOP|GOP@PEK||PEK|WOC|2015-10-14 10:59:00+08:00|2015-10-14 10:59:00+08:00||&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2016 03:47:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-regex-rules-in-props-conf-and-transforms-conf-to/m-p/235807#M70025</guid>
      <dc:creator>prachisaxena</dc:creator>
      <dc:date>2016-01-19T03:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply regex rules in props.conf and transforms.conf to filter unstructured data before indexing it in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-regex-rules-in-props-conf-and-transforms-conf-to/m-p/235808#M70026</link>
      <description>&lt;P&gt;An excellent place to test regular expressions is &lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Header\S+521|\s&lt;/CODE&gt; should be enough to break your event. &lt;/P&gt;

&lt;P&gt;As for the field extraction, can you give some examples of what your trying to extract? The regex you've posted looks like it will match every character&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2016 17:34:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-regex-rules-in-props-conf-and-transforms-conf-to/m-p/235808#M70026</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-01-19T17:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply regex rules in props.conf and transforms.conf to filter unstructured data before indexing it in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-regex-rules-in-props-conf-and-transforms-conf-to/m-p/235809#M70027</link>
      <description>&lt;P&gt;Thank you very much for helping.&lt;BR /&gt;
The log file is pipe delimited ( although not completely). I have created regex to extract all the fields delimited by pipe. After this using the &lt;STRONG&gt;FORMAT&lt;/STRONG&gt; statement, i am extracting only the required text from &lt;STRONG&gt;REGEX&lt;/STRONG&gt; lets say &lt;STRONG&gt;$1&lt;/STRONG&gt; and &lt;STRONG&gt;$7&lt;/STRONG&gt; ( or &lt;STRONG&gt;f1&lt;/STRONG&gt; and &lt;STRONG&gt;f7&lt;/STRONG&gt;).  After this i need to only retain the lines where f7=&lt;STRONG&gt;SCL&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;512 15206781 14447916361 SCL@TYO 384 P 2&amp;#15; 10GNS2@GOC Header|15206|02|00|521||&lt;STRONG&gt;SCL@TYO&lt;/STRONG&gt;||scl11adm|TYO|---|2015-10-14 12:00:36+09:00|2015-10-14 12:00:36+09:00|2015-10-14 11:00:36+08:00|&lt;BR /&gt;
Identifier 9929275941|&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 01:54:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-regex-rules-in-props-conf-and-transforms-conf-to/m-p/235809#M70027</guid>
      <dc:creator>prachisaxena</dc:creator>
      <dc:date>2016-01-20T01:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply regex rules in props.conf and transforms.conf to filter unstructured data before indexing it in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-apply-regex-rules-in-props-conf-and-transforms-conf-to/m-p/235810#M70028</link>
      <description>&lt;P&gt;Have a look at the following. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/Forwarding/Routeandfilterdatad"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.2/Forwarding/Routeandfilterdatad&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/42718/filter-indexing-to-avoid-license-issues.html"&gt;https://answers.splunk.com/answers/42718/filter-indexing-to-avoid-license-issues.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 10:04:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-apply-regex-rules-in-props-conf-and-transforms-conf-to/m-p/235810#M70028</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-01-20T10:04:26Z</dc:date>
    </item>
  </channel>
</rss>

