<?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 Set transform base on sourcetype in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Set-transform-base-on-sourcetype/m-p/707512#M21201</link>
    <description>&lt;DIV&gt;Hi, I'm using the Journald input in univarsal forwarder to collect logs form journald: &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.3.2/Data/CollecteventsfromJournalD" target="_blank" rel="noopener noreferrer"&gt;https://docs.splunk.com/Documentation/Splunk/9.3.2/Data/CollecteventsfromJournalD&lt;/A&gt;. When the data comes, I set the sourcetype dynamically based on the value of the journald TRANSPORT field. This works fine.&lt;/DIV&gt;&lt;DIV&gt;After that, I would like to apply other transforms to the logs with a certain sourcetypes e.g. remove the logs if the log has a certain phrase. Unfortunately, for some reason, the second transform is not working. Here is the props and configs that I'm using&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;here is my transforms.conf:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;[set_new_sourcetype]&lt;/DIV&gt;&lt;DIV&gt;SOURCE_KEY = field:TRANSPORT&lt;/DIV&gt;&lt;DIV&gt;REGEX = ([^\s]+)&lt;/DIV&gt;&lt;DIV&gt;FORMAT = sourcetype::$1&lt;/DIV&gt;&lt;DIV&gt;DEST_KEY = MetaData:Sourcetype&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;[setnull_syslog_test]&lt;/DIV&gt;&lt;DIV&gt;REGEX = (?i)test&lt;/DIV&gt;&lt;DIV&gt;DEST_KEY = queue&lt;/DIV&gt;&lt;DIV&gt;FORMAT = nullQueue&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;here is my pros.conf:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;[source::journald:///var/log/journal]&lt;/DIV&gt;&lt;DIV&gt;TRANSFORMS-change_sourcetype = set_new_sourcetype&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;[sourcetype::syslog]&lt;/DIV&gt;&lt;DIV&gt;TRANSFORMS-setnull = setnull_syslog_test&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Any idea why the setnull_syslog_test transform is not working?&lt;/DIV&gt;</description>
    <pubDate>Mon, 23 Dec 2024 21:25:25 GMT</pubDate>
    <dc:creator>MichalC</dc:creator>
    <dc:date>2024-12-23T21:25:25Z</dc:date>
    <item>
      <title>Set transform base on sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Set-transform-base-on-sourcetype/m-p/707512#M21201</link>
      <description>&lt;DIV&gt;Hi, I'm using the Journald input in univarsal forwarder to collect logs form journald: &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.3.2/Data/CollecteventsfromJournalD" target="_blank" rel="noopener noreferrer"&gt;https://docs.splunk.com/Documentation/Splunk/9.3.2/Data/CollecteventsfromJournalD&lt;/A&gt;. When the data comes, I set the sourcetype dynamically based on the value of the journald TRANSPORT field. This works fine.&lt;/DIV&gt;&lt;DIV&gt;After that, I would like to apply other transforms to the logs with a certain sourcetypes e.g. remove the logs if the log has a certain phrase. Unfortunately, for some reason, the second transform is not working. Here is the props and configs that I'm using&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;here is my transforms.conf:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;[set_new_sourcetype]&lt;/DIV&gt;&lt;DIV&gt;SOURCE_KEY = field:TRANSPORT&lt;/DIV&gt;&lt;DIV&gt;REGEX = ([^\s]+)&lt;/DIV&gt;&lt;DIV&gt;FORMAT = sourcetype::$1&lt;/DIV&gt;&lt;DIV&gt;DEST_KEY = MetaData:Sourcetype&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;[setnull_syslog_test]&lt;/DIV&gt;&lt;DIV&gt;REGEX = (?i)test&lt;/DIV&gt;&lt;DIV&gt;DEST_KEY = queue&lt;/DIV&gt;&lt;DIV&gt;FORMAT = nullQueue&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;here is my pros.conf:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;[source::journald:///var/log/journal]&lt;/DIV&gt;&lt;DIV&gt;TRANSFORMS-change_sourcetype = set_new_sourcetype&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;[sourcetype::syslog]&lt;/DIV&gt;&lt;DIV&gt;TRANSFORMS-setnull = setnull_syslog_test&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Any idea why the setnull_syslog_test transform is not working?&lt;/DIV&gt;</description>
      <pubDate>Mon, 23 Dec 2024 21:25:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Set-transform-base-on-sourcetype/m-p/707512#M21201</guid>
      <dc:creator>MichalC</dc:creator>
      <dc:date>2024-12-23T21:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set transform base on sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Set-transform-base-on-sourcetype/m-p/707513#M21202</link>
      <description>&lt;P&gt;Two things.&lt;/P&gt;&lt;P&gt;1. Stanzas are (unless explicitly set for source or host) based on sourcetype. Don't put "sourcetype::" in stanza specification.&lt;/P&gt;&lt;P&gt;2. If your idea was to cast sourcetype from A to B and then use transforms defined for sourcetype B then it won't work. The list of operations which will be performed on an event is decided at the beginning of the ingestion pipeline. The only way to change it "midflight" is to use the CLONE_SOURCETYPE transform but it's more complicated than simple sourcetype rewrite.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 21:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Set-transform-base-on-sourcetype/m-p/707513#M21202</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-12-23T21:53:41Z</dc:date>
    </item>
  </channel>
</rss>

