<?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: Change index at index time (chained UFs) in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332819#M61567</link>
    <description>&lt;P&gt;If  I understood your problem correctly, you want to put data into index named index-$custom$-win-event, I think you need to update your tranforms.conf stanza as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Set-Index-Windows]
 SOURCE_KEY = field:customfield
 REGEX = (.+)
 DEST_KEY = _MetaData:Index
 FORMAT = index-$1-win-event
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Jun 2017 10:25:55 GMT</pubDate>
    <dc:creator>hardikJsheth</dc:creator>
    <dc:date>2017-06-01T10:25:55Z</dc:date>
    <item>
      <title>Change index at index time (chained UFs)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332818#M61566</link>
      <description>&lt;P&gt;I am collecting Windows Event Logs via either a Windows Event Collector or directly from each Windows server (with a Splunk UF installed). I am then using an intermediate forwarder to send to our indexers. This is due to network setup and location of the servers.&lt;/P&gt;

&lt;P&gt;I have custom metadata that the intermediate forwarder is adding to identify where the logs are coming from and use in the index name.&lt;/P&gt;

&lt;P&gt;The problem I am having is that the Windows Event Logs are hitting the Main index and not the one I've specified in transforms.&lt;/P&gt;

&lt;P&gt;On the intermediate forwarder I have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;inputs.conf
[splunktcp:9997]
acceptFrom = *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On the destination Indexer I have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;props.conf
[source::WinEventLog:ForwardedEvents]
TRANSFORMS-Host = Set-Host-ComputerName
TRANSFORMS-LogName = Set-Sourcetype-LogName
TRANSFORMS-Index-Windows = Set-Index-Windows

[sourcetype::WinEventLog:*]
TRANSFORMS-Index-Windows = Set-Index-Windows
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;transforms.conf
[Set-Host-ComputerName]
REGEX = (?m)ComputerName=(.+)?\b
DEST_KEY = MetaData:Host
FORMAT = host::$1

[Set-Sourcetype-LogName]
REGEX = (?m)LogName=(.+)?\b
DEST_KEY = MetaData:Sourcetype
FORMAT = sourcetype::windows:event:$1

[Set-Index-Windows]
SOURCE_KEY = MetaData:customfield
REGEX = (.+)
DEST_KEY = _MetaData:Index
FORMAT = index-$1-win-event
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 10:07:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332818#M61566</guid>
      <dc:creator>danbrook</dc:creator>
      <dc:date>2017-06-01T10:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change index at index time (chained UFs)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332819#M61567</link>
      <description>&lt;P&gt;If  I understood your problem correctly, you want to put data into index named index-$custom$-win-event, I think you need to update your tranforms.conf stanza as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Set-Index-Windows]
 SOURCE_KEY = field:customfield
 REGEX = (.+)
 DEST_KEY = _MetaData:Index
 FORMAT = index-$1-win-event
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 10:25:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332819#M61567</guid>
      <dc:creator>hardikJsheth</dc:creator>
      <dc:date>2017-06-01T10:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Change index at index time (chained UFs)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332820#M61568</link>
      <description>&lt;P&gt;The custom field is set like this on the intermediate forwarder:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[default]
_meta = customfield::ACustomString
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 10:31:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332820#M61568</guid>
      <dc:creator>danbrook</dc:creator>
      <dc:date>2017-06-01T10:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Change index at index time (chained UFs)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332821#M61569</link>
      <description>&lt;P&gt;SOURCE_KEY = field:customfield - This didn't work I'm afraid.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 13:50:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332821#M61569</guid>
      <dc:creator>danbrook</dc:creator>
      <dc:date>2017-06-01T13:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Change index at index time (chained UFs)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332822#M61570</link>
      <description>&lt;P&gt;If the custom field is set on the intermediate forwarder, I have to assume the intermediate forwarder is a heavy forwarder.  If that's the case, it's sending cooked data to your indexer.  The indexer won't re-cook data (under normal configuration, and best practice), so changing sourcetype/index/etc won't have any affect.&lt;/P&gt;

&lt;P&gt;For a potential (against best practice) workaround, see this previous answer:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/97918/reparsing-cooked-data-coming-from-a-heavy-forwarder-possible.html"&gt;Reparsing cooked data coming from a heavy forwarder. Possible?&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 14:09:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332822#M61570</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-06-01T14:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Change index at index time (chained UFs)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332823#M61571</link>
      <description>&lt;P&gt;The Intermediate Forward is a Universal Forwarder. The custom metadata is being added to the logs.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 15:59:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-index-at-index-time-chained-UFs/m-p/332823#M61571</guid>
      <dc:creator>danbrook</dc:creator>
      <dc:date>2017-06-01T15:59:41Z</dc:date>
    </item>
  </channel>
</rss>

