<?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 Clone an event based on a indexed field in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Clone-an-event-based-on-a-indexed-field/m-p/656973#M111253</link>
    <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have a source which comes in via HEC into an index.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The sourcetyping currently is dynamic.&lt;BR /&gt;We then route data based on a indexed label the data to a specific index.&lt;BR /&gt;&lt;BR /&gt;Here comes the catch.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If we have another indexed field called label we want to clone that event into a new index and sourcetype&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;props.conf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[(?::){0}kube:container:*] 
TRANSFORMS-route_by_domain_label = route_by_domain_label&lt;/LI-CODE&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;&lt;P&gt;transforms.conf&lt;/P&gt;&lt;P&gt;We route the data based on a label which is custom named k8s_label for the example here&lt;/P&gt;&lt;P&gt;and for sensitive data we also have a label called : label_sensitive&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[route_index_by_label_domain]
SOURCE_KEY = field:k8s_label
REGEX = index_domain_(\w+)
FORMAT = indexname_$1
DEST_KEY = _MetaData:Index

[clone_when_sensitive]
SOURCE_KEY = field:label_sensitive
REGEX = true
DEST_KEY = _MetaData:Sourcetype
#CLONE_SOURCETYPE = sensitive_events
FORMAT = sourcetype::sensitive_events&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2023 14:43:40 GMT</pubDate>
    <dc:creator>duijva1</dc:creator>
    <dc:date>2023-09-07T14:43:40Z</dc:date>
    <item>
      <title>Clone an event based on a indexed field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Clone-an-event-based-on-a-indexed-field/m-p/656973#M111253</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have a source which comes in via HEC into an index.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The sourcetyping currently is dynamic.&lt;BR /&gt;We then route data based on a indexed label the data to a specific index.&lt;BR /&gt;&lt;BR /&gt;Here comes the catch.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If we have another indexed field called label we want to clone that event into a new index and sourcetype&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;props.conf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[(?::){0}kube:container:*] 
TRANSFORMS-route_by_domain_label = route_by_domain_label&lt;/LI-CODE&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;&lt;P&gt;transforms.conf&lt;/P&gt;&lt;P&gt;We route the data based on a label which is custom named k8s_label for the example here&lt;/P&gt;&lt;P&gt;and for sensitive data we also have a label called : label_sensitive&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[route_index_by_label_domain]
SOURCE_KEY = field:k8s_label
REGEX = index_domain_(\w+)
FORMAT = indexname_$1
DEST_KEY = _MetaData:Index

[clone_when_sensitive]
SOURCE_KEY = field:label_sensitive
REGEX = true
DEST_KEY = _MetaData:Sourcetype
#CLONE_SOURCETYPE = sensitive_events
FORMAT = sourcetype::sensitive_events&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 14:43:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Clone-an-event-based-on-a-indexed-field/m-p/656973#M111253</guid>
      <dc:creator>duijva1</dc:creator>
      <dc:date>2023-09-07T14:43:40Z</dc:date>
    </item>
  </channel>
</rss>

