<?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: Help with props and transforms in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458402#M79217</link>
    <description>&lt;P&gt;Not entirely sure why your current transforms is not working (except that you are not showing the respective props.conf line) but this is typically resolved with calculated fields or lookups, rather than transforms. &lt;/P&gt;

&lt;P&gt;For example, in props.conf (this also gets rid of the need for a FIELDALIAS):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-action = case(ACTION="Allow","allowed",ACTION="Permit","allowed")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When the number of options grows, a lookup might be a more suitable approach.&lt;/P&gt;

&lt;P&gt;PS: any specific reason you're using a custom regex, rather than setting &lt;CODE&gt;KV_MODE = xml&lt;/CODE&gt; in props.conf?&lt;/P&gt;</description>
    <pubDate>Mon, 13 May 2019 15:13:26 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2019-05-13T15:13:26Z</dc:date>
    <item>
      <title>Help with props and transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458400#M79215</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a feed where the fields are separated by brackets (&amp;lt;&amp;gt;).    I have a transforms.conf that extracts the fields automatically:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = &amp;lt;([^\/][^&amp;gt;]+)&amp;gt;(.*?)&amp;lt;\/[^&amp;gt;]+&amp;gt;
FORMAT = $1::$2
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Unfortunately, the fields are all uppercase.  I don't see any way to make the fields lowercase, so I've started creating aliases, using FIELD_ALIAS.  We need to do this so that they are caught by our ES rules.   I also need to do a transforms to map the values appropriately.  &lt;/P&gt;

&lt;P&gt;Here is a sample field:  "Allow&lt;/P&gt;

&lt;P&gt;I  want to create an alias with the field name to be "action" and a transform that makes the value "allowed".  I get the new field, but the transform is not working.  Here's what I have configured:&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FIELDALIAS-action = ACTION as action
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[forcepoint_xml]
REGEX = &amp;lt;([^\/][^&amp;gt;]+)&amp;gt;(.*?)&amp;lt;\/[^&amp;gt;]+&amp;gt;
FORMAT = $1::$2
MV_ADD = true

[ACTION]
REGEX = (Allow|Permit)
FORMAT = ACTION::allowed
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any suggestions?  &lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 14:25:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458400#M79215</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2019-05-13T14:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help with props and transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458401#M79216</link>
      <description>&lt;P&gt;you might be able to just use eval instead of a field alias.  Maybe like this...obviously you can additional allowed/blocked logic:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-action = if(match(ACTION,"(?i)allow|permit"),"allowed","blocked")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could also create an automatic lookup to lookup ACTION and spit out the various actions as well - maybe not needed here, but that approach can come in handy in general when mapping data to the CIM.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 15:13:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458401#M79216</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2019-05-13T15:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help with props and transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458402#M79217</link>
      <description>&lt;P&gt;Not entirely sure why your current transforms is not working (except that you are not showing the respective props.conf line) but this is typically resolved with calculated fields or lookups, rather than transforms. &lt;/P&gt;

&lt;P&gt;For example, in props.conf (this also gets rid of the need for a FIELDALIAS):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-action = case(ACTION="Allow","allowed",ACTION="Permit","allowed")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When the number of options grows, a lookup might be a more suitable approach.&lt;/P&gt;

&lt;P&gt;PS: any specific reason you're using a custom regex, rather than setting &lt;CODE&gt;KV_MODE = xml&lt;/CODE&gt; in props.conf?&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 15:13:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458402#M79217</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-05-13T15:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help with props and transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458403#M79218</link>
      <description>&lt;P&gt;It's not proper xml - just bracket seperated fields, so the KV_MODE doesnt' work.  &lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 15:25:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458403#M79218</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2019-05-13T15:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with props and transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458404#M79219</link>
      <description>&lt;P&gt;You can convert everything in the raw event to lower-case like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-ToLowerCase = s/\(.*\)/\L\1/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 May 2019 22:12:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458404#M79219</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-05-13T22:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help with props and transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458405#M79220</link>
      <description>&lt;P&gt;I thought about that, but what's the load when doing that?  It's not a super busy feed, but not small either.  &lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 02:06:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458405#M79220</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2019-05-14T02:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with props and transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458406#M79221</link>
      <description>&lt;P&gt;There's only one way to know: YOLO!&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 02:17:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458406#M79221</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-05-14T02:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with props and transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458407#M79222</link>
      <description>&lt;P&gt;You might want to make that a bit more specific to only make the keys lowercase, not the values.&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 07:13:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458407#M79222</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-05-14T07:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help with props and transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458408#M79223</link>
      <description>&lt;P&gt;Couldn't this all be done with one SED command (building on @maciep's suggestion)? I haven't tested but I imagine something with capture groups and forcing lowercase. This essentially combines what everyone else has said.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;SED-yaay = s/&amp;gt;(allow|permit)&amp;lt;/\L\1/i&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The syntax is prob all wrong but the point is that instead of capturing anything you're capturing the specific terms you wanted, using the &lt;CODE&gt;/i&lt;/CODE&gt; at the end to do case irrelevant. Using the &lt;CODE&gt;\L&lt;/CODE&gt; that @woodcock introduced to force case on output.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 12:42:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458408#M79223</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2019-07-01T12:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with props and transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458409#M79224</link>
      <description>&lt;P&gt;How about a sample of the _raw with all your corporate stuff removed. That will help us help you.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 12:43:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-props-and-transforms/m-p/458409#M79224</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2019-07-01T12:43:03Z</dc:date>
    </item>
  </channel>
</rss>

