<?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: Routing log data to different indexes based on the source in Splunk Cloud Platform</title>
    <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702161#M3303</link>
    <description>&lt;P&gt;Ahhh... the SOURCE_KEY part I missed &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; Good catch!&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2024 10:09:41 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-10-17T10:09:41Z</dc:date>
    <item>
      <title>Routing log data to different indexes based on the source</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/701980#M3289</link>
      <description>&lt;P&gt;I have been working on routing logs based on their source into different indexes. I configured below props.conf and transforms.conf on my HF, but it didn't worked. We currently follow the naming convention below for our CloudWatch log group names:&lt;/P&gt;&lt;P&gt;/starflow-app-logs-&amp;lt;platform-name&amp;gt;/&amp;lt;team-id&amp;gt;/&amp;lt;app-nam&lt;SPAN&gt;e&amp;gt;/&amp;lt;app-environment-name&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------&lt;SPAN&gt;-&lt;BR /&gt;&lt;/SPAN&gt;Example sources:&lt;BR /&gt;--------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;us-east-1:/starflow-app-logs/sandbox/test/prod&lt;BR /&gt;us-east-1:/starflow-app-logs-dev/sandbox/test/dev&lt;BR /&gt;us-east-1:/starflow-app-logs-stage/sandbox/test/stage&lt;BR /&gt;&lt;BR /&gt;Note: We are currently receiving log data for the above use case from the us-east-1 region.&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------&lt;BR /&gt;Condition:&lt;BR /&gt;--------------------------------------------------------------------------&lt;BR /&gt;If the source path contains &amp;lt;team-id&amp;gt;, logs should be routed to the respective index in Splunk. If the source path contains any &amp;lt;team-id&amp;gt;, its logs will be routed to the same &amp;lt;team-id&amp;gt;-based index, which already exists in our Splunk environment.&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------&lt;BR /&gt;props.conf&lt;BR /&gt;--------------------------------------------------------------------------&lt;BR /&gt;[source::us-east-1:/starflow-app-logs*]&lt;BR /&gt;TRANSFORMS-set_starflow_logging = new_sourcetype, route_to_teamid_index&lt;BR /&gt;&lt;BR /&gt;--------------------------------------------------------------------------&lt;BR /&gt;transforms.conf&lt;BR /&gt;--------------------------------------------------------------------------&lt;BR /&gt;[new_sourcetype]&lt;BR /&gt;REGEX = .*&lt;BR /&gt;SOURCE_KEY = source&lt;BR /&gt;DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;FORMAT = sourcetype::aws:kinesis:starflow&lt;BR /&gt;WRITE_META = true&lt;/P&gt;&lt;P&gt;[route_to_teamid_index]&lt;BR /&gt;REGEX = us-east-1:\/starflow-app-logs(?:-[a-z]+)?\/([a-zA-Z0-9]+)\/&lt;BR /&gt;SOURCE_KEY = source&lt;BR /&gt;FORMAT = index::$1&lt;BR /&gt;DEST_KEY = _MetaData:Index&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-10-15 232943.png" style="width: 585px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/33109i8112EFE61EF132A3/image-dimensions/585x189?v=v2" width="585" height="189" role="button" title="Screenshot 2024-10-15 232943.png" alt="Screenshot 2024-10-15 232943.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I’d be grateful for any feedback or suggestions to improve this configuration. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 19:29:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/701980#M3289</guid>
      <dc:creator>dj064</dc:creator>
      <dc:date>2024-10-15T19:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Routing log data to different indexes based on the source</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/701991#M3292</link>
      <description>&lt;P&gt;Is that commented line " #to exract &amp;lt;team-id&amp;gt; from source" on the same line as the regex in your transforms.conf? If so, that should be on a separate line otherwise Splunk will consider it part of the regex.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 19:05:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/701991#M3292</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2024-10-15T19:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Routing log data to different indexes based on the source</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/701995#M3293</link>
      <description>&lt;P&gt;Nope,&amp;nbsp;&lt;SPAN&gt;I only included it for clarity while writing this post; it’s not part of my actual configuration.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Note: I have removed that part from my post as well.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 19:30:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/701995#M3293</guid>
      <dc:creator>dj064</dc:creator>
      <dc:date>2024-10-15T19:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Routing log data to different indexes based on the source</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/701996#M3294</link>
      <description>&lt;PRE&gt;*   matches anything but the path separator 0 or more times.
    The path separator is '/' on unix, or '\' on Windows.
    Intended to match a partial or complete directory or filename.&lt;/PRE&gt;&lt;P&gt;So for your props.conf stanza you should rather use&lt;/P&gt;&lt;PRE&gt;... recurses through directories until the match is met
    or equivalently, matches any number of characters.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 19:44:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/701996#M3294</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-10-15T19:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Routing log data to different indexes based on the source</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/701997#M3295</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;for suggestion. &amp;nbsp;Shall I use below config?&lt;/P&gt;&lt;P&gt;[source::.../starflow-app-logs*/...]&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 20:03:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/701997#M3295</guid>
      <dc:creator>dj064</dc:creator>
      <dc:date>2024-10-15T20:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Routing log data to different indexes based on the source</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/701999#M3296</link>
      <description>&lt;P&gt;That's one of the options. But "*/..." makes no sense. It's enough to just use ...&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 20:29:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/701999#M3296</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-10-15T20:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Routing log data to different indexes based on the source</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702077#M3298</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;still it is not working.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 15:00:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702077#M3298</guid>
      <dc:creator>dj064</dc:creator>
      <dc:date>2024-10-16T15:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Routing log data to different indexes based on the source</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702085#M3299</link>
      <description>&lt;P&gt;First things first.&lt;/P&gt;&lt;P&gt;1. Just for the sake of completness of the info - the logs are ingested by inputs on this HF? Not forwarded from remote?&lt;/P&gt;&lt;P&gt;2. To debug one thing at a time I'd start with something foolproof like a simple SEDCMD adding a single letter to an event transform and attach it to a source. This way you're not wondering whether the props part is wrong or the transform itself. When you make sure the props entry is OK because your transform is actually getting called, get to debug your index overwriting.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 16:23:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702085#M3299</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-10-16T16:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Routing log data to different indexes based on the source</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702105#M3300</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;Thanks for suggestion.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I made the following changes in transforms.conf:&lt;/P&gt;&lt;P&gt;1) For [new_sourcetype]&lt;BR /&gt;- Removed SOURCE_KEY = source&lt;/P&gt;&lt;P&gt;2) For [route_to_teamid_index]&lt;BR /&gt;- Updated the regex&lt;BR /&gt;- Set WRITE_META = true&lt;/P&gt;&lt;P&gt;After these changes, the sourcetype value successfully changed to "aws:kinesis:starflow", but the data did not route to the specified index. Instead, it went to the default index.&lt;/P&gt;&lt;P&gt;current configs:&lt;BR /&gt;-----------------------------------------------------------------------------&lt;BR /&gt;props&lt;BR /&gt;-----------------------------------------------------------------------------&lt;BR /&gt;#custom-props-for-starflow-logs&lt;BR /&gt;[&lt;FONT color="#FF0000"&gt;source::.../starflow-app-logs...&lt;/FONT&gt;]&lt;BR /&gt;&lt;FONT color="#000000"&gt;TRANSFORMS-set_new_sourcetype = new_sourcetype&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;TRANSFORMS-set_route_to_teamid_index = route_to_teamid_index&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------&lt;BR /&gt;transforms&lt;BR /&gt;-----------------------------------------------------------------------------&lt;BR /&gt;#custom-transforms-for-starflow-logs&lt;BR /&gt;[new_sourcetype]&lt;BR /&gt;REGEX = .*&lt;BR /&gt;DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;FORMAT = sourcetype::aws:kinesis:starflow&lt;BR /&gt;WRITE_META = true&lt;/P&gt;&lt;P&gt;[route_to_teamid_index]&lt;BR /&gt;REGEX = &lt;FONT color="#FF0000"&gt;.*\/starflow-app-logs(?:-[a-z]+)?\/([a-zA-Z0-9]+)\/&lt;/FONT&gt;&lt;BR /&gt;SOURCE_KEY = source&lt;BR /&gt;FORMAT = index::$1&lt;BR /&gt;DEST_KEY = _MetaData:Index&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;WRITE_META = true&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;I'm confident that both my props.conf and [new_sourcetype] stanza in transforms.conf are functioning correctly. The only issue seems to be with [route_to_teamid_index].&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 18:17:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702105#M3300</guid>
      <dc:creator>dj064</dc:creator>
      <dc:date>2024-10-16T18:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Routing log data to different indexes based on the source</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702107#M3301</link>
      <description>&lt;P&gt;Try&lt;/P&gt;&lt;PRE&gt;FORMAT=$1&lt;BR /&gt;DEST=_MetaData:Index&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Oct 2024 19:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702107#M3301</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-10-16T19:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Routing log data to different indexes based on the source</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702152#M3302</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;, Thank you for your suggestions.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;After following your suggestions, the configurations are now working correctly for my use case. Here are the changes I made for [route_to_teamid_index] stanza in transforms.conf:&lt;BR /&gt;&lt;BR /&gt;1) For [route_to_teamid_index]&lt;BR /&gt;- &lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;Set&lt;/FONT&gt; FORMAT = $1&lt;/FONT&gt;&lt;BR /&gt;- Updated&amp;nbsp;&lt;FONT color="#FF0000"&gt;SOURCE_KEY = MetaData:Source&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Current working configs for my use cases:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;-----------------------------------------------------------------------------&lt;BR /&gt;props&lt;BR /&gt;-----------------------------------------------------------------------------&lt;BR /&gt;#custom-props-for-starflow-logs&lt;BR /&gt;[source::.../starflow-app-logs...]&lt;BR /&gt;TRANSFORMS-set_new_sourcetype = new_sourcetype&lt;BR /&gt;TRANSFORMS-set_route_to_teamid_index = route_to_teamid_index&lt;BR /&gt;&lt;BR /&gt;-----------------------------------------------------------------------------&lt;BR /&gt;transforms&lt;BR /&gt;-----------------------------------------------------------------------------&lt;BR /&gt;#custom-transforms-for-starflow-logs&lt;BR /&gt;[new_sourcetype]&lt;BR /&gt;REGEX = .*&lt;BR /&gt;DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;FORMAT = sourcetype::aws:kinesis:starflow&lt;BR /&gt;WRITE_META = true&lt;BR /&gt;&lt;BR /&gt;[route_to_teamid_index]&lt;BR /&gt;REGEX = .*\/starflow-app-logs(?:-[a-z]+)?\/([a-zA-Z0-9]+)\/&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;SOURCE_KEY = MetaData:Source&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;FORMAT = $1&lt;/FONT&gt;&lt;BR /&gt;DEST_KEY = _MetaData:Index&lt;BR /&gt;WRITE_META = true&lt;/PRE&gt;&lt;P&gt;&lt;FONT color="#FF9900"&gt;&lt;FONT color="#000000"&gt;Previously, the configuration had &lt;FONT color="#FF6600"&gt;SOURCE_KEY = source&lt;/FONT&gt;, which was causing issues. The SOURCE_KEY = &amp;lt;field&amp;gt; setting essentially tells Splunk where the regex should be applied. In my configuration, it was set to "source" but Splunk might not have been able to apply the regex to just the source field. After spending time reading through &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.3.1/Admin/Transformsconf#GLOBAL_SETTINGS" target="_blank" rel="noopener"&gt;transforms.conf&lt;/A&gt;, I noticed that under the &lt;FONT color="#339966"&gt;global settings&lt;/FONT&gt;, there was a specific mention of this.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;SOURCE_KEY = &amp;lt;string&amp;gt;&lt;/FONT&gt;
* NOTE: This setting is valid for both index-time and search-time field
  extractions.
* Optional. Defines the KEY that Splunk software applies the REGEX to.
* For search time extractions, you can use this setting to extract one or
  more values from the values of another field. You can use any field that
  is available at the time of the execution of this field extraction
* &lt;FONT color="#FF0000"&gt;For index-time extractions use the KEYs&lt;/FONT&gt; described at the bottom of this
  file.
  * KEYs are case-sensitive, and should be used exactly as they appear in
    the KEYs list at the bottom of this file. (For example, you would say
    &lt;FONT color="#FF0000"&gt;SOURCE_KEY = MetaData:Host&lt;/FONT&gt;, *not* SOURCE_KEY = metadata:host .)&lt;FONT color="#FF9900"&gt;&lt;FONT color="#000000"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.3.1/Admin/Transformsconf#KEYS:" target="_blank" rel="noopener"&gt;Keys&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;MetaData:Source&lt;/FONT&gt;    &amp;nbsp;: The source associated with the event.&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Thank you sincerely for all of your genuine help!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 09:13:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702152#M3302</guid>
      <dc:creator>dj064</dc:creator>
      <dc:date>2024-10-17T09:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Routing log data to different indexes based on the source</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702161#M3303</link>
      <description>&lt;P&gt;Ahhh... the SOURCE_KEY part I missed &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; Good catch!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 10:09:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Routing-log-data-to-different-indexes-based-on-the-source/m-p/702161#M3303</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-10-17T10:09:41Z</dc:date>
    </item>
  </channel>
</rss>

