<?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: Create custom fields at indextime on Heavy Forwarders in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679185#M113499</link>
    <description>If I recall right you shouldn’t use DEST_KEY= fieldname, just remove that line. Usually splunk write that into _meta field and then it create indexed fields based on that information in indexers.</description>
    <pubDate>Thu, 29 Feb 2024 17:44:18 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2024-02-29T17:44:18Z</dc:date>
    <item>
      <title>Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679138#M113490</link>
      <description>&lt;P&gt;Hi at all,&lt;/P&gt;&lt;P&gt;I have to create a custom field at index time, I did it following the documentation but there's something wrong.&lt;/P&gt;&lt;P&gt;The field to read is a parte of the source field 8as you can read in the REGEX.&lt;/P&gt;&lt;P&gt;I deployed using a Deployment Server on my Heavy Forwarders an app contaning the following files:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;fields.conf&lt;/LI&gt;&lt;LI&gt;props.conf&lt;/LI&gt;&lt;LI&gt;transforms.conf&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;in fields.conf I inserted&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[fieldname]
INDEXED = True&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in props.conf I inserted:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[default]
TRANSFORMS-abc = fieldname&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in transforms.conf I inserted:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[fieldname]
REGEX = /var/log/remote/([^/]+)/.*
FORMAT = fieldname::$1
WRITE_META = true
DEST_KEY = fieldname
SOURCE_KEY = source
REPEAT_MATCH = false
LOOKAHEAD = 100&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;where's the error? what I missed?&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 15:33:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679138#M113490</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-02-29T15:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679185#M113499</link>
      <description>If I recall right you shouldn’t use DEST_KEY= fieldname, just remove that line. Usually splunk write that into _meta field and then it create indexed fields based on that information in indexers.</description>
      <pubDate>Thu, 29 Feb 2024 17:44:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679185#M113499</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-02-29T17:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679219#M113500</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.2.0/Admin/Transformsconf#KEYS" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Admin/Transformsconf#KEYS&lt;/A&gt;:&lt;/P&gt;&lt;PRE&gt;SOURCE_KEY = MetaData:Source&lt;/PRE&gt;&lt;P&gt;BTW, you don't need fields.conf on the HF. You need it on SH.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 09:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679219#M113500</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-03-01T09:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679239#M113503</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp; and &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your yints,&lt;/P&gt;&lt;P&gt;this is the new transforms.conf&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[relay_hostname]
REGEX = (/var/log/remote/)([^/]+)(/.*)
FORMAT = relay_hostname::$2
WRITE_META = true
#DEST_KEY = relay_hostname
SOURCE_KEY = MetaData:Source
REPEAT_MATCH = false&lt;/LI-CODE&gt;&lt;P&gt;I tried with your hints but they don't run, what could I try again?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 08:42:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679239#M113503</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-01T08:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679241#M113504</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I also tried to solve the issue at search time, but there are many sourcetypes to associate this field, so I tried to create a field extraction to associate to source=/var/log/remote/*, but it still doesn't run, probably because I cannot use the jolly char in a source for field extractions.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 08:54:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679241#M113504</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-01T08:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679244#M113505</link>
      <description>&lt;P&gt;How about INGEST_EVAL? Here are some examples&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/How-to-get-props-and-transforms-to-extract-time-from-source/m-p/644598/highlight/true#M109720" target="_blank"&gt;https://community.splunk.com/t5/Getting-Data-In/How-to-get-props-and-transforms-to-extract-time-from-source/m-p/644598/highlight/true#M109720&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596865" target="_blank"&gt;https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596865&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 01 Mar 2024 09:17:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679244#M113505</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-01T09:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679247#M113506</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;thank you for your hint, but using INGEST-EVAL, I can use an eval function, instead I need to use a regex to extract a field from another field.&lt;/P&gt;&lt;P&gt;The correct way is the first I used but there's something wrong and I don't understand what.&lt;/P&gt;&lt;P&gt;Maybe the source field isn't still extracted when I try to extract with a regex a part of the path.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 09:40:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679247#M113506</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-01T09:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679252#M113507</link>
      <description>As I have used replace on those examples, you can use it same way.&lt;BR /&gt;On those cases I have take some part of source (e.g. yyyymmmdd from file path) and use it as a field value.&lt;BR /&gt;&lt;BR /&gt;Basically replace is a one way to use regex on splunk.</description>
      <pubDate>Fri, 01 Mar 2024 09:50:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679252#M113507</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-01T09:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679256#M113508</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I tried your solution:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[relay_hostname]
INGEST_EVAL = relay_hostname = replace(source, "(/var/log/remote/)([^/]+)(/.*)","\2")&lt;/LI-CODE&gt;&lt;P&gt;with no luck.&lt;/P&gt;&lt;P&gt;As I said, I have the doubt that I would extract the new field from the source field that maybe isn't still extracted!&lt;/P&gt;&lt;P&gt;I also tried a transformation at search time:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gcusello_0-1709287522407.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29564i4A74FB2214921600/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gcusello_0-1709287522407.png" alt="gcusello_0-1709287522407.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;with the same result.&lt;/P&gt;&lt;P&gt;thank you and ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 10:05:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679256#M113508</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-01T10:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679257#M113509</link>
      <description>&lt;P&gt;Based on your example data etc. this works.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval source="/var/log/remote/abc/def.xyx"
| eval relay_hostname = replace(source, "/var/log/remote/([^/]+)/.*","\1")&lt;/LI-CODE&gt;&lt;P&gt;So it should work also on props.conf!&lt;/P&gt;&lt;P&gt;Are you absolutely sure that those sourcetype names are correct on your props.conf and that there are not any CLONE_SOURCETYPE etc. which can lead to wrong path? You should also check that there is no host or source definitions which overrides that sourcetype &amp;nbsp;definition.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 10:14:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679257#M113509</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-01T10:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679258#M113510</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;yes I have some CLONE_SOURCETYPE, but I applied the transformation in props.conf in the default stanza:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[default]
TRANSFORMS-abc = fieldname&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and this should be applied to all the sourcetypes.&lt;/P&gt;&lt;P&gt;Maybe I could try to apply to source:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[source::/var/log/remote/*]
TRANSFORMS-abc = fieldname&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 10:25:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679258#M113510</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-01T10:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679259#M113511</link>
      <description>&lt;P&gt;At least earlier I have had some issue to use [default]. The end result was that I must move those to actual sourcetype definition or otherwise those didn't affect as I was hopping.&lt;/P&gt;&lt;P&gt;Also CLONE_SOURCETYPE has some caveat when you want to manipulate it. I think that &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&amp;nbsp;has some case on last autumn about this, where we try to solve same kind of situation?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 10:28:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679259#M113511</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-01T10:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679262#M113512</link>
      <description>&lt;P&gt;I didn't notice that it was in the [default] stanza. I'm not sure but I seem to recall that there was something about it and applying a "default transform".&lt;/P&gt;&lt;P&gt;Stupid question but just to be on the safe side - you don't have any HF before this one? (so you're doing all this on the parsing component, not just getting parsed data from earlier, right?). Oh, and remember that if you're using indexed extractions, they are parsed at UF so your transforms won't work on them later.&lt;/P&gt;&lt;P&gt;Anyway, assuming that it's done in the proper spot in the path, I'd try something like that to verify that the transform is being run at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[relay_hostname]
REGEX = .
FORMAT = relay_hostname::constantvalue
WRITE_META = true
SOURCE_KEY = MetaData:Source
REPEAT_MATCH = false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, with&lt;/P&gt;&lt;PRE&gt;(/var/log/remote/)([^/]+)(/.*)&lt;/PRE&gt;&lt;P&gt;you don't have to capture neither first nor last group. You just need to capture the middle part so your regex can as well just be&lt;/P&gt;&lt;PRE&gt;/var/log/remote/([^/]+)/.*&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Mar 2024 11:17:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679262#M113512</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-03-01T11:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679270#M113515</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;the use of [default] stanza is a must because I have many sourcetypes and I would avoid to write a stanza for each of them.&lt;/P&gt;&lt;P&gt;For this reason I also tried to use [source::/var/log/*] but it didn't run!.&lt;/P&gt;&lt;P&gt;Anyway, there isn't any othe HF before of these because this is an rsyslog server that receives syslogs.&lt;/P&gt;&lt;P&gt;Thank you, have you any other check that I could try?&lt;/P&gt;&lt;P&gt;Now I'm trying using a fixed string to understand if the issue is in the regx or in the [default] stanza.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 11:56:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679270#M113515</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-01T11:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679273#M113516</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I also tried to associate the transformation to a sourcetype and it doesn't work:&lt;/P&gt;&lt;P&gt;In props.conf:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[cisco:ios]
TRANSFORMS-relay_hostname = relay_hostname
[cisco:ise:syslog]
TRANSFORMS-relay_hostname = relay_hostname
[f5:bigip:ltm:tcl:error]
TRANSFORMS-relay_hostname = relay_hostname
[f5:bigip:syslog]
TRANSFORMS-relay_hostname = relay_hostname
[fortigate_event]
TRANSFORMS-relay_hostname = relay_hostname
[fortigate_traffic]
TRANSFORMS-relay_hostname = relay_hostname
[infoblox:audit]
TRANSFORMS-relay_hostname = relay_hostname
[infoblox:dhcp]
TRANSFORMS-relay_hostname = relay_hostname
[infoblox:dns]
TRANSFORMS-relay_hostname = relay_hostname
[infoblox:file]
TRANSFORMS-relay_hostname = relay_hostname
[juniper:junos:firewall]
TRANSFORMS-relay_hostname = relay_hostname
[juniper:junos:switch]
TRANSFORMS-relay_hostname = relay_hostname
[pan:system]
TRANSFORMS-relay_hostname = relay_hostname
[pan:traffic]
TRANSFORMS-relay_hostname = relay_hostname
[pan:userid]
TRANSFORMS-relay_hostname = relay_hostname
[pps_log]
TRANSFORMS-relay_hostname = relay_hostname&lt;/LI-CODE&gt;&lt;P&gt;in transforms.conf:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[relay_hostname]
REGEX = /var/log/remote/([^/]+)/.*
FORMAT = relay_hostname::$1
WRITE_META = true
SOURCE_KEY = MetaData:Source
REPEAT_MATCH = false&lt;/LI-CODE&gt;&lt;P&gt;and also tried:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[relay_hostname]
INGEST_EVAL = relay_hostname = replace(source, "(/var/log/remote/)([^/]+)(/.*)","\2")&lt;/LI-CODE&gt;&lt;P&gt;but both thies failed!&lt;/P&gt;&lt;P&gt;Thank you for your support, have you any other idea, wher to search the issue?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 13:05:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679273#M113516</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-01T13:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679279#M113517</link>
      <description>I have had several hundreds sourcetypes in m case &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; Fortunately we have automation for generating those props.conf.</description>
      <pubDate>Fri, 01 Mar 2024 13:54:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679279#M113517</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-01T13:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679280#M113518</link>
      <description>Can you test in your dedicate single server test environment with sample data? That way you could be sure that those confs are correct. After that just install those into correct place on your real deployment.</description>
      <pubDate>Fri, 01 Mar 2024 13:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679280#M113518</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-01T13:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679287#M113519</link>
      <description>&lt;P&gt;OK. Something is definitely weird with your setup then,&lt;/P&gt;&lt;P&gt;I did a quick test on my home lab.&lt;/P&gt;&lt;PRE&gt;# cat props.conf &lt;BR /&gt;[routeros]&lt;BR /&gt;TRANSFORMS-add_source_based_field = add_source_based_field&lt;BR /&gt;&lt;BR /&gt;# cat transforms.conf &lt;BR /&gt;[add_source_based_field]&lt;BR /&gt;REGEX = udp:(.*)&lt;BR /&gt;FORMAT = source_source_port::$1&lt;BR /&gt;WRITE_META = true&lt;BR /&gt;SOURCE_KEY = MetaData:Source&lt;BR /&gt;REPEAT_MATCH = false&lt;/PRE&gt;&lt;P&gt;As you can see, for events coming from my mikrotik router it calls a transform which adds a field called source_source_port containing the port number extracted from the source field.&lt;/P&gt;&lt;P&gt;And it works.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PickleRick_0-1709303809049.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29565i4908B403C2D777E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PickleRick_0-1709303809049.png" alt="PickleRick_0-1709303809049.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So the mechanism is sound and the configuration is pretty OK. Now the question is why it doesn't work for you.&lt;/P&gt;&lt;P&gt;One thing which can _sometimes_ be tricky here (but it's highly unlikely that you have that problem with all your sourcetypes) is that it might be not that obvious which config is effective when your sourcetype is recast on ingestion because props and transforms are applied only for the original sourcetype even if it's changed during the processing in the pipeline (I think we already talked about it :-)) .&lt;/P&gt;&lt;P&gt;But as far as I recognize some of your sourcetypes at least some of them are not recast (pps_log for sure, for example)&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 14:40:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679287#M113519</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-03-01T14:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679306#M113520</link>
      <description>You said that you have CLONE_SOURCETYPE in use. Are you applied these transforms to original or cloned ST?</description>
      <pubDate>Fri, 01 Mar 2024 15:51:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679306#M113520</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-01T15:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom fields at indextime on Heavy Forwarders</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679314#M113521</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;both of them!&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 16:17:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Create-custom-fields-at-indextime-on-Heavy-Forwarders/m-p/679314#M113521</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-01T16:17:14Z</dc:date>
    </item>
  </channel>
</rss>

