<?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: Regexp for transform.conf doesnt work in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Regexp-for-transform-conf-doesnt-work/m-p/362791#M66124</link>
    <description>&lt;P&gt;Actually I'm getting nothing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
I mean that nothing extracted at all except field vendor_product which defined as EVAL-vendor_product = "Radware" in props.conf&lt;BR /&gt;
You can see it on screenshot &lt;A href="https://ibb.co/d6qhoR" target="_blank"&gt;https://ibb.co/d6qhoR&lt;/A&gt;&lt;BR /&gt;
How could I debug fields extraction?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 16:44:09 GMT</pubDate>
    <dc:creator>evkuzin</dc:creator>
    <dc:date>2020-09-29T16:44:09Z</dc:date>
    <item>
      <title>Regexp for transform.conf doesnt work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regexp-for-transform-conf-doesnt-work/m-p/362789#M66122</link>
      <description>&lt;P&gt;Splunk receive a log like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Nov 15 13:02:10 172.20.20.3 test WARNING 1 "Invalid path" 178.217.60.3 0 10.18.7.98 2040 5 "bla bla bla" sampled 1 0 N/A low drop FFFFFFFF-FFFF-FFFF-000E-000059C98546
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And vendor said that each field is separated by a single space character. Fields that may contain spaces are printed between double quotes. So for each field i use configuration like this:&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[test_source]
REPORT-device_ip=device_ip
REPORT-attack_name=attack_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[device_ip]
REGEX = (".*?"|\S+)
FORMAT = device_ip::$4
MV_ADD = true

[attack_name]
REGEX = (".*?"|\S+)
FORMAT = attack_name::$8
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've already test regexp with &lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt; and it should just split fields in accordance to vendors documentation, but it doesn't work.&lt;/P&gt;

&lt;P&gt;all files I put in /opt/splunk/etc/system/local/&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 14:22:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regexp-for-transform-conf-doesnt-work/m-p/362789#M66122</guid>
      <dc:creator>evkuzin</dc:creator>
      <dc:date>2017-11-15T14:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Regexp for transform.conf doesnt work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regexp-for-transform-conf-doesnt-work/m-p/362790#M66123</link>
      <description>&lt;P&gt;The second IP address ("defence_attack_name") is group #9, not 8.&lt;BR /&gt;
When you say "it doesn't work", what exactly do you mean?  What results are you getting?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:44:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regexp-for-transform-conf-doesnt-work/m-p/362790#M66123</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-29T16:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Regexp for transform.conf doesnt work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regexp-for-transform-conf-doesnt-work/m-p/362791#M66124</link>
      <description>&lt;P&gt;Actually I'm getting nothing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
I mean that nothing extracted at all except field vendor_product which defined as EVAL-vendor_product = "Radware" in props.conf&lt;BR /&gt;
You can see it on screenshot &lt;A href="https://ibb.co/d6qhoR" target="_blank"&gt;https://ibb.co/d6qhoR&lt;/A&gt;&lt;BR /&gt;
How could I debug fields extraction?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:44:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regexp-for-transform-conf-doesnt-work/m-p/362791#M66124</guid>
      <dc:creator>evkuzin</dc:creator>
      <dc:date>2020-09-29T16:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Regexp for transform.conf doesnt work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regexp-for-transform-conf-doesnt-work/m-p/362792#M66125</link>
      <description>&lt;P&gt;Have you tried setting the MV_Add to its default value? Which is false.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 15:13:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regexp-for-transform-conf-doesnt-work/m-p/362792#M66125</guid>
      <dc:creator>joebisesi</dc:creator>
      <dc:date>2018-11-28T15:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Regexp for transform.conf doesnt work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regexp-for-transform-conf-doesnt-work/m-p/362793#M66126</link>
      <description>&lt;P&gt;Your regex contains just 1 capturing group, so how can you refer to $4 and $8?&lt;/P&gt;

&lt;P&gt;Yes, this regex matches all the bits separated by spaces, but this is not how you extract fields from an event like this.&lt;/P&gt;

&lt;P&gt;Approaches that would work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (".*?"|\S+)\s(".*?"|\S+)\s(".*?"|\S+)\s etc.
FORMAT = field1::$1 field2::$2 field3::$3 etc.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which uses a regex that matches the event as a whole and extracts each field into a capture group and then assigns those capture groups to the relevant fieldname.&lt;/P&gt;

&lt;P&gt;Or:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (?:(?:".*?"|\S+)\s){10}(".*?"|\S+)
FORMAT = ip::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which skips over X (10 in this example) fields and then extracts a single piece to assign to a specific field.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 15:31:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regexp-for-transform-conf-doesnt-work/m-p/362793#M66126</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-11-28T15:31:26Z</dc:date>
    </item>
  </channel>
</rss>

