<?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: transforms.conf returning events that match REGEX value as value of FORMAT key in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-returning-events-that-match-REGEX-value-as-value/m-p/294613#M55978</link>
    <description>&lt;P&gt;A capturing group is basically within &lt;CODE&gt;( )&lt;/CODE&gt; have a read here &lt;A href="https://answers.splunk.com/answers/214487/can-i-extract-a-field-with-a-regexed-dynamic-field.html"&gt;https://answers.splunk.com/answers/214487/can-i-extract-a-field-with-a-regexed-dynamic-field.html&lt;/A&gt; where I used two capturing groups &lt;CODE&gt;$1&lt;/CODE&gt; and &lt;CODE&gt;$2&lt;/CODE&gt; both were created using this regex &lt;CODE&gt;([a-z]+)=([a-z]+)&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;Also starting a regex with &lt;CODE&gt;.*&lt;/CODE&gt; is .... let's call suboptimal because it matches everything. I would optimise the nullQueue regex to match the things you don't want and skip the &lt;CODE&gt;[passthru]&lt;/CODE&gt; completely &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2017 00:31:04 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2017-10-12T00:31:04Z</dc:date>
    <item>
      <title>transforms.conf returning events that match REGEX value as value of FORMAT key</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-returning-events-that-match-REGEX-value-as-value/m-p/294609#M55974</link>
      <description>&lt;P&gt;I am trying to build a filter so I only index events that match this regex: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.*[%].* 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I asked a &lt;A href="https://answers.splunk.com/answers/578692/using-the-transformsconf-file-to-only-forward-even-1.html#comment-578697"&gt;question previously that was answered&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;I was able to change the data coming into my system using this transform: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[filter-debug]
REGEX=.*[%].*
DEST_KEY = _raw
FORMAT = $1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem I am experiencing is that anything matching my REGEX has it's _raw replaced with whatever I set the FORMAT to be. So in the example above all of my events matching my regex would return a literal "$1" as their event data. This was the case no matter what I put into FORMAT and I can't get rid of FORMAT because it just defaults to &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[filter-debug]::$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And so then that's what all my events look like. Thoughts?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 23:05:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-returning-events-that-match-REGEX-value-as-value/m-p/294609#M55974</guid>
      <dc:creator>JordanPeterson</dc:creator>
      <dc:date>2017-10-11T23:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: transforms.conf returning events that match REGEX value as value of FORMAT key</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-returning-events-that-match-REGEX-value-as-value/m-p/294610#M55975</link>
      <description>&lt;P&gt;Usually &lt;CODE&gt;$1&lt;/CODE&gt; refers to the first capturing group, but I don't see a capturing group in your regex?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 23:11:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-returning-events-that-match-REGEX-value-as-value/m-p/294610#M55975</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-10-11T23:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: transforms.conf returning events that match REGEX value as value of FORMAT key</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-returning-events-that-match-REGEX-value-as-value/m-p/294611#M55976</link>
      <description>&lt;P&gt;I believe I figured it out. My new transforms.conf looks like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# drop everything that doesn't match [passthru]
 [drop-debug]
  REGEX =.*
  DEST_KEY = queue
  FORMAT = nullQueue

# send everything else on to the indexer
 [passthru]
 REGEX=.*[%].*
 DEST_KEY = queue
 FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think my previous problem was trying to send to _raw after sending to indexQueue didn't work. &lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 23:13:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-returning-events-that-match-REGEX-value-as-value/m-p/294611#M55976</guid>
      <dc:creator>JordanPeterson</dc:creator>
      <dc:date>2017-10-11T23:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: transforms.conf returning events that match REGEX value as value of FORMAT key</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-returning-events-that-match-REGEX-value-as-value/m-p/294612#M55977</link>
      <description>&lt;P&gt;Could you clarify what a capturing group is? If I just wrapped my regex in a couple parans would that make it a capturing group? &lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 23:34:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-returning-events-that-match-REGEX-value-as-value/m-p/294612#M55977</guid>
      <dc:creator>JordanPeterson</dc:creator>
      <dc:date>2017-10-11T23:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: transforms.conf returning events that match REGEX value as value of FORMAT key</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-returning-events-that-match-REGEX-value-as-value/m-p/294613#M55978</link>
      <description>&lt;P&gt;A capturing group is basically within &lt;CODE&gt;( )&lt;/CODE&gt; have a read here &lt;A href="https://answers.splunk.com/answers/214487/can-i-extract-a-field-with-a-regexed-dynamic-field.html"&gt;https://answers.splunk.com/answers/214487/can-i-extract-a-field-with-a-regexed-dynamic-field.html&lt;/A&gt; where I used two capturing groups &lt;CODE&gt;$1&lt;/CODE&gt; and &lt;CODE&gt;$2&lt;/CODE&gt; both were created using this regex &lt;CODE&gt;([a-z]+)=([a-z]+)&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;Also starting a regex with &lt;CODE&gt;.*&lt;/CODE&gt; is .... let's call suboptimal because it matches everything. I would optimise the nullQueue regex to match the things you don't want and skip the &lt;CODE&gt;[passthru]&lt;/CODE&gt; completely &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 00:31:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-returning-events-that-match-REGEX-value-as-value/m-p/294613#M55978</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-10-12T00:31:04Z</dc:date>
    </item>
  </channel>
</rss>

