<?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 Reassigning / replacing a sourcetype based on source in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Reassigning-replacing-a-sourcetype-based-on-source/m-p/702671#M116217</link>
    <description>&lt;P&gt;I am looking to replace a sourcetype using props.conf / transforms.conf so far with no luck.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;props.conf

[original_sourcetype]
NO_BINARY_CHECK = 1
SHOULD_LINEMERGE = false
TIME_PREFIX = oldtimeprefix

TIME_FORMAT=oldtimeformat
pulldown_type = 1
TRANSFORMS-set_new=set_new_sourcetype

[new_sourcetype_with_new_timeformat]
NO_BINARY_CHECK=1
SHOULD_LINEMERGE=false
TIME_PREFIX=newtimeprefix
TIME_FORMAT=newtimeformat
pulldown_type = 1
#rename=original_sourcetype



transforms.conf

[set_new_sourcetype]
SOURCE_KEY = MetaData:Source
REGEX = ^source::var/log/path/tofile.log
FORMAT = sourcetype::new_sourcetype_with_new_timeformat
DEST_KEY = MetaData:Sourcetype&lt;/LI-CODE&gt;
&lt;P&gt;tried different REGEX's, including&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;REGEX = var/log/path/tofile.log&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also tried setting it like this in props.conf&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[source::var/log/path/tofile.log]
TRANSFORMS-set_new=set_new_sourcetype&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am also looking at inputs.conf, which has monitoring stanzas for all syslog traffic, perhaps some blacklisting/ whitelisting based on source can be done there.&lt;/P&gt;
&lt;P&gt;But I am curious as to what is not working with my props/transforms.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Oct 2024 18:10:05 GMT</pubDate>
    <dc:creator>beataficek</dc:creator>
    <dc:date>2024-10-24T18:10:05Z</dc:date>
    <item>
      <title>Reassigning / replacing a sourcetype based on source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Reassigning-replacing-a-sourcetype-based-on-source/m-p/702671#M116217</link>
      <description>&lt;P&gt;I am looking to replace a sourcetype using props.conf / transforms.conf so far with no luck.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;props.conf

[original_sourcetype]
NO_BINARY_CHECK = 1
SHOULD_LINEMERGE = false
TIME_PREFIX = oldtimeprefix

TIME_FORMAT=oldtimeformat
pulldown_type = 1
TRANSFORMS-set_new=set_new_sourcetype

[new_sourcetype_with_new_timeformat]
NO_BINARY_CHECK=1
SHOULD_LINEMERGE=false
TIME_PREFIX=newtimeprefix
TIME_FORMAT=newtimeformat
pulldown_type = 1
#rename=original_sourcetype



transforms.conf

[set_new_sourcetype]
SOURCE_KEY = MetaData:Source
REGEX = ^source::var/log/path/tofile.log
FORMAT = sourcetype::new_sourcetype_with_new_timeformat
DEST_KEY = MetaData:Sourcetype&lt;/LI-CODE&gt;
&lt;P&gt;tried different REGEX's, including&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;REGEX = var/log/path/tofile.log&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also tried setting it like this in props.conf&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[source::var/log/path/tofile.log]
TRANSFORMS-set_new=set_new_sourcetype&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am also looking at inputs.conf, which has monitoring stanzas for all syslog traffic, perhaps some blacklisting/ whitelisting based on source can be done there.&lt;/P&gt;
&lt;P&gt;But I am curious as to what is not working with my props/transforms.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 18:10:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Reassigning-replacing-a-sourcetype-based-on-source/m-p/702671#M116217</guid>
      <dc:creator>beataficek</dc:creator>
      <dc:date>2024-10-24T18:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Reassigning / replacing a sourcetype based on source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Reassigning-replacing-a-sourcetype-based-on-source/m-p/702687#M116220</link>
      <description>&lt;P&gt;The value of the REGEX attribute must be a valid regular expression that contains at least one capturing group.&amp;nbsp; The expression is used to match the data in the incoming event (_raw) and cannot use key specifiers such as 'source::'.&amp;nbsp; Try these transforms&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[set_new_sourcetype]
SOURCE_KEY = MetaData:Source
REGEX = (/var/log/path/tofile.log)
FORMAT = sourcetype::new_sourcetype_with_new_timeformat
DEST_KEY = MetaData:Sourcetype&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 24 Oct 2024 12:26:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Reassigning-replacing-a-sourcetype-based-on-source/m-p/702687#M116220</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-10-24T12:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reassigning / replacing a sourcetype based on source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Reassigning-replacing-a-sourcetype-based-on-source/m-p/702691#M116222</link>
      <description>&lt;P&gt;OK. Sourcetype rewriting is one thing but I have a hunch that you're trying to not only get a particular metadata field rewritten but would also like to reprocess whole event with the new sourcetype. And that's (depending on how much "back" you would want to go) is either much more difficult or plain impossible.&lt;/P&gt;&lt;P&gt;See here - &lt;A href="https://community.splunk.com/t5/Getting-Data-In/Diagrams-of-how-indexing-works-in-the-Splunk-platform-the-Masa/m-p/590774" target="_blank"&gt;https://community.splunk.com/t5/Getting-Data-In/Diagrams-of-how-indexing-works-in-the-Splunk-platform-the-Masa/m-p/590774&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The event comes through all stages of the ingestion pipeline in sequence and there is no way for an event to "go back". Even if you rewrite the sourcetype, it will still get processed further "down the street" according to the props/transforms from the original sourcetype. The only difference will be that it will be written into the index with the new sourcetype and when you search your data the search-time props for the new sourcetype will be applied.&lt;/P&gt;&lt;P&gt;There is one "exception" - if you use CLONE_SOURCETYPE, the event will be "forked" and a new copy with the new sourcetype will be ingested again into the pipeline but it will still be after linebreaking and - as far as I remember - after timestamp parsing.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 12:44:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Reassigning-replacing-a-sourcetype-based-on-source/m-p/702691#M116222</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-10-24T12:44:51Z</dc:date>
    </item>
  </channel>
</rss>

