<?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: How to configure props and transforms.conf to rename a dynamic set of field names at search-time? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215893#M42468</link>
    <description>&lt;P&gt;Thanks for this!&lt;/P&gt;

&lt;P&gt;I do already have the Extract for the action, however my issue now lies with how can I then remove action from the front of the key=value pairs where it exists, and without breaking my original extract (not having to modify any of the _raw data). &lt;/P&gt;</description>
    <pubDate>Tue, 21 Jun 2016 21:14:02 GMT</pubDate>
    <dc:creator>goodsellt</dc:creator>
    <dc:date>2016-06-21T21:14:02Z</dc:date>
    <item>
      <title>How to configure props and transforms.conf to rename a dynamic set of field names at search-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215890#M42465</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;I'm struggling to understand how I can use the transforms.conf stanza's to rename dynamic set of field names, ideally using the output of of a separate extraction (or just a regex which may be able to match it).&lt;/P&gt;

&lt;P&gt;My problem more specifically is, I receive a series of events from a server which are key'd using the action being performed; the data looks like the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;name=steve host=xxx download.doc_name=myfile.doc download.doc_id=12345 download.doc_owner=jeff

name=jeff host=yyy rename.new_doc_name=renamed.xls rename.old_doc_name=original.xls rename.doc_owner=jeff
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and so on, essentially events have static metadata like the user performing the action, and information about the system they are on as regular key=value, however, when it comes to the action taken, anything relating to the action is stored as (action.key)=value.&lt;/P&gt;

&lt;P&gt;What I'm looking for is a way to use the transforms and props stanzas to dynamically modify the fields so we can use them in searches as if they were like the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;name=steve host=xxx action=download doc_name=myfile.doc doc_id=12345 doc_owner=jeff

name=jeff host=yyy action=rename new_doc_name=renamed.xls old_doc_name=original.xls doc_owner=jeff
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm able to get the action= item easily enough, however, I can't seem to find any way to then strip the action &amp;amp; period from the front of the rest of the other key=value pairs. I'm unable to just do this statically, as there are far more actions, with each having potentially their own individual key=value pairs (such as new_doc_name &amp;amp; old_doc_name for rename actions). &lt;/P&gt;

&lt;P&gt;Ideally I'd like to be able to use this transform with a few different sourcetypes which have similar formatting to this (but we keep separate based on some other factors). &lt;/P&gt;

&lt;P&gt;Anyone with more experience know if doing something like I mentioned is possible? Please note that trying to change the data before it indexes into Splunk is not currently an option.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:59:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215890#M42465</guid>
      <dc:creator>goodsellt</dc:creator>
      <dc:date>2020-09-29T09:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure props and transforms.conf to rename a dynamic set of field names at search-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215891#M42466</link>
      <description>&lt;P&gt;I'd also like to point out I want to avoid just doing a regex which just matches everything after the period, as I'm worried that there may be instances where a legitimate period would appear in the key name or possibly in one of the values (such as IP address) and it would cause problems because of that.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 20:59:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215891#M42466</guid>
      <dc:creator>goodsellt</dc:creator>
      <dc:date>2016-06-21T20:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure props and transforms.conf to rename a dynamic set of field names at search-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215892#M42467</link>
      <description>&lt;P&gt;Assuming you've configuration to get key and value separated (means you're able to get new_doc_name=abc.xls old_doc_name=xyz.xls ), then (assuming action is same for all fields in the event) you could just extract action using a EXTRACT attribute in props.conf.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
EXTRACT-action = \s+(?&amp;lt;Action&amp;gt;[^\.]+)\S+=
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:59:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215892#M42467</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T09:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure props and transforms.conf to rename a dynamic set of field names at search-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215893#M42468</link>
      <description>&lt;P&gt;Thanks for this!&lt;/P&gt;

&lt;P&gt;I do already have the Extract for the action, however my issue now lies with how can I then remove action from the front of the key=value pairs where it exists, and without breaking my original extract (not having to modify any of the _raw data). &lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 21:14:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215893#M42468</guid>
      <dc:creator>goodsellt</dc:creator>
      <dc:date>2016-06-21T21:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure props and transforms.conf to rename a dynamic set of field names at search-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215894#M42469</link>
      <description>&lt;P&gt;How many possible values of action you can have (just the action)? &lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 21:16:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215894#M42469</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-21T21:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure props and transforms.conf to rename a dynamic set of field names at search-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215895#M42470</link>
      <description>&lt;P&gt;I'm not positive, it seems like there is around 16 or so but there may be actions which I have not seen yet due to their rarity, as well as any potential new actions which may be added into this data set from new sources. &lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 21:20:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215895#M42470</guid>
      <dc:creator>goodsellt</dc:creator>
      <dc:date>2016-06-21T21:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure props and transforms.conf to rename a dynamic set of field names at search-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215896#M42471</link>
      <description>&lt;P&gt;Yup, maintenance and accuracy will be an issue. If it was not, they you could have created (along with field extraction for action) a FIELDALIAS entries in props.conf for each possible action&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [yoursourcetype]
FIELDALIAS-alias = download.* AS * rename.* AS * ....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jun 2016 21:28:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215896#M42471</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-21T21:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure props and transforms.conf to rename a dynamic set of field names at search-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215897#M42472</link>
      <description>&lt;P&gt;Just add this to the end:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | foreach *.* [ rename $&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;$ AS "&amp;lt;&amp;lt;MATCHSEG2&amp;gt;&amp;gt;" ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | foreach *.* [ eval  "&amp;lt;&amp;lt;MATCHSEG2&amp;gt;&amp;gt;"=$&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;$]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jun 2016 03:37:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215897#M42472</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-22T03:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure props and transforms.conf to rename a dynamic set of field names at search-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215898#M42473</link>
      <description>&lt;P&gt;I'm looking to do this with the props &amp;amp; transforms fields, not with actual search commands, though thanks for the suggestions.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 18:59:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215898#M42473</guid>
      <dc:creator>goodsellt</dc:creator>
      <dc:date>2016-06-23T18:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure props and transforms.conf to rename a dynamic set of field names at search-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215899#M42474</link>
      <description>&lt;P&gt;I'm struggling understanding why the transforms.conf file seems to be rather ineffective compared with a pure EXTRACT in the props file:&lt;/P&gt;

&lt;P&gt;my transform.conf stanza is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    [get_action]
    REGEX = (\w+)\.action\=    
    FORMAT = action::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;inside props I have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[custom_sourcetype]
...standard stuff...
REPORT-action = get_action
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However it's only returning 5% coverage across my events.&lt;/P&gt;

&lt;P&gt;If I just do inside props:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[custom_sourcetype]
....standard stuff...
EXTRACT-action = (?&amp;lt;action&amp;gt;\w+)\.action\=
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get 100% coverage in my events. &lt;/P&gt;

&lt;P&gt;Can anyone explain this behavior?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 19:04:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215899#M42474</guid>
      <dc:creator>goodsellt</dc:creator>
      <dc:date>2016-06-23T19:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure props and transforms.conf to rename a dynamic set of field names at search-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215900#M42475</link>
      <description>&lt;P&gt;Just wanted to say I was able to solve this by using multiple report stanzas:&lt;/P&gt;

&lt;P&gt;props:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetype-ex]
Report-test = stanza1, stanza2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[stanza1]
REGEX = (\w+)\\.action\=
FORMAT = action::$1

[stanza2]
REGEX = \w+\\.(\w+)\=(\"[^"]+\"|\S+)
FORMAT = $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2016 20:21:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-props-and-transforms-conf-to-rename-a-dynamic/m-p/215900#M42475</guid>
      <dc:creator>goodsellt</dc:creator>
      <dc:date>2016-09-14T20:21:22Z</dc:date>
    </item>
  </channel>
</rss>

