<?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: Is it possible to create an if/else statement with the TRANSFORMS_ field into props.conf file ? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-create-an-if-else-statement-with-the/m-p/631622#M108259</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253534"&gt;@Zanusha443&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you have to set in the inputs.conf the index that doesn't match the regex.&lt;/P&gt;&lt;P&gt;Then on Indexers, or (if present) in Heavy Forwarders, you have to override index value using props.conf and transforms.conf.&lt;/P&gt;&lt;P&gt;in props.conf:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[your_sourcetype]
TRANSFORMS-index = overrideindex&lt;/LI-CODE&gt;&lt;P&gt;in transforms.conf:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[overrideindex]
DEST_KEY =_MetaData:Index
REGEX = src_host\=(?:10\.10\.10\.\d{1,3}|)
FORMAT = my_new_index&lt;/LI-CODE&gt;&lt;P&gt;supponing that&amp;nbsp;&lt;EM&gt;src_host\=(?:10\.10\.10\.\d{1,3}|) &lt;/EM&gt;is the regex for events to be sent to the other index.&lt;/P&gt;&lt;P&gt;Beware to the location of these files: if you have one or more intermediate Heavy Forwarders, you have to put them on the first HF, if there isn't any HF, you have to put them on Indexers.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Feb 2023 17:46:51 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-02-20T17:46:51Z</dc:date>
    <item>
      <title>Is it possible to create an if/else statement with the TRANSFORMS_ field into props.conf file ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-create-an-if-else-statement-with-the/m-p/631617#M108255</link>
      <description>&lt;P&gt;I have data coming from a single source&lt;/P&gt;&lt;P&gt;but I want to send the events that match a REGEX to an index and all the other that not match it to another index.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have already tried to change the order of the fields into the&amp;nbsp;TRANSFORMS_ but it still put the events in both indexes.&lt;BR /&gt;This is the content of the&lt;STRONG&gt; props.conf file:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[tmpproxy]&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TRANSFORMS_routing1 =CIDR_Routing_matched, CIDR_Routing_others&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;and this is the content of the &lt;STRONG&gt;transforms.conf file:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[CIDR_Routing_matched]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;REGEX =src_host\=(?:10\.10\.10\.\d{1,3}|)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;FORMAT = tmp_matched_proxy&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;DEST_KEY=_MetaData:Index&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;WRITE_META=true&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[CIDR_Routing_others]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;REGEX =.+&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;FORMAT = tmp_others_proxy&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;DEST_KEY=_MetaData:Index&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;WRITE_META=true&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Is it possible to stop the&amp;nbsp;TRANSFORMS_ field in the props.conf file after the first good match?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 17:17:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-create-an-if-else-statement-with-the/m-p/631617#M108255</guid>
      <dc:creator>Zanusha443</dc:creator>
      <dc:date>2023-02-20T17:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to create an if/else statement with the TRANSFORMS_ field into props.conf file ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-create-an-if-else-statement-with-the/m-p/631622#M108259</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253534"&gt;@Zanusha443&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you have to set in the inputs.conf the index that doesn't match the regex.&lt;/P&gt;&lt;P&gt;Then on Indexers, or (if present) in Heavy Forwarders, you have to override index value using props.conf and transforms.conf.&lt;/P&gt;&lt;P&gt;in props.conf:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[your_sourcetype]
TRANSFORMS-index = overrideindex&lt;/LI-CODE&gt;&lt;P&gt;in transforms.conf:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[overrideindex]
DEST_KEY =_MetaData:Index
REGEX = src_host\=(?:10\.10\.10\.\d{1,3}|)
FORMAT = my_new_index&lt;/LI-CODE&gt;&lt;P&gt;supponing that&amp;nbsp;&lt;EM&gt;src_host\=(?:10\.10\.10\.\d{1,3}|) &lt;/EM&gt;is the regex for events to be sent to the other index.&lt;/P&gt;&lt;P&gt;Beware to the location of these files: if you have one or more intermediate Heavy Forwarders, you have to put them on the first HF, if there isn't any HF, you have to put them on Indexers.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 17:46:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-create-an-if-else-statement-with-the/m-p/631622#M108259</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-02-20T17:46:51Z</dc:date>
    </item>
  </channel>
</rss>

