<?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: How to change the index at index time in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-index-at-index-time/m-p/151574#M30844</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Method 1 :&lt;/STRONG&gt;&lt;BR /&gt;
The optimal solution is to open several ports, one for each index and have your syslog routed to the proper port.&lt;/P&gt;

&lt;P&gt;example :&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[udp:514]&lt;BR /&gt;
index=myindexA&lt;BR /&gt;
[udp:515]&lt;BR /&gt;
index=myindexB&lt;BR /&gt;
[udp:516]&lt;BR /&gt;
index=myindexC&lt;BR /&gt;
 #etc...&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
It is also possible to then enforce a sourcetype or a timezone per source .&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;&lt;STRONG&gt;Method 2:&lt;/STRONG&gt; If you cannot separate your inputs, then you have to create props/transforms rules to change the index based on : the content of the events, or the host.&lt;/P&gt;

&lt;P&gt;see&lt;BR /&gt;
in inputs.conf&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[udp:514]&lt;BR /&gt;
index=myindexA&lt;BR /&gt;
sourcetype=syslog&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;in props.conf&lt;BR /&gt;
To apply only for your input&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[source::udp:514]&lt;BR /&gt;
TRANSFORMS-changeindex=routeIndexbasedonhost, routeIndexbasedonevent&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
OR to apply to all syslog sourcetype&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
[syslog]&lt;BR /&gt;
TRANSFORMS-changeindex=routeIndexbasedonhost, routeIndexbasedonevent&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;in transforms.conf&lt;/P&gt;

&lt;P&gt;`&lt;BR /&gt;
[routeIndexbasedonhost]&lt;BR /&gt;
SOURCE_KEY = MetaData:Host&lt;BR /&gt;
REGEX=(ftp|vpn)&lt;BR /&gt;
DEST_KEY=_MetaData:Index&lt;BR /&gt;
FORMAT=myindexB&lt;BR /&gt;
WRITE_META=true&lt;/P&gt;

&lt;P&gt;[routeIndexbasedonevent]&lt;BR /&gt;
REGEX=(AUDIT|ALERT)&lt;BR /&gt;
DEST_KEY=_MetaData:Index&lt;BR /&gt;
FORMAT=myindexC&lt;BR /&gt;
WRITE_META=true&lt;BR /&gt;
`&lt;/P&gt;

&lt;P&gt;The order of the transforms is important:&lt;BR /&gt;
TRANSFORMS-changeindex=routeIndexbasedonhost, routeIndexbasedonevent&lt;BR /&gt;
 will have : myindexA for all,  then some will become myindexB, and finally some will become myindexC&lt;BR /&gt;
so the last one will overwrite the previous ones.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 17:08:09 GMT</pubDate>
    <dc:creator>yannK</dc:creator>
    <dc:date>2020-09-28T17:08:09Z</dc:date>
    <item>
      <title>How to change the index at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-index-at-index-time/m-p/151573#M30843</link>
      <description>&lt;P&gt;I have data coming from syslog udp:514&lt;BR /&gt;
but I want to send some events to a different index.&lt;/P&gt;

&lt;P&gt;Depending of :&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt; the host they are coming from : &lt;EM&gt;ftp&lt;/EM&gt; or &lt;EM&gt;vpn&lt;/EM&gt; should go to indexB&lt;/LI&gt;
&lt;LI&gt;some keywords in the events. "AUDIT" or "ALERT" should go to indexC&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 21 Jul 2014 22:12:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-index-at-index-time/m-p/151573#M30843</guid>
      <dc:creator>mataharry</dc:creator>
      <dc:date>2014-07-21T22:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the index at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-index-at-index-time/m-p/151574#M30844</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Method 1 :&lt;/STRONG&gt;&lt;BR /&gt;
The optimal solution is to open several ports, one for each index and have your syslog routed to the proper port.&lt;/P&gt;

&lt;P&gt;example :&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[udp:514]&lt;BR /&gt;
index=myindexA&lt;BR /&gt;
[udp:515]&lt;BR /&gt;
index=myindexB&lt;BR /&gt;
[udp:516]&lt;BR /&gt;
index=myindexC&lt;BR /&gt;
 #etc...&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
It is also possible to then enforce a sourcetype or a timezone per source .&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;&lt;STRONG&gt;Method 2:&lt;/STRONG&gt; If you cannot separate your inputs, then you have to create props/transforms rules to change the index based on : the content of the events, or the host.&lt;/P&gt;

&lt;P&gt;see&lt;BR /&gt;
in inputs.conf&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[udp:514]&lt;BR /&gt;
index=myindexA&lt;BR /&gt;
sourcetype=syslog&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;in props.conf&lt;BR /&gt;
To apply only for your input&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[source::udp:514]&lt;BR /&gt;
TRANSFORMS-changeindex=routeIndexbasedonhost, routeIndexbasedonevent&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
OR to apply to all syslog sourcetype&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
[syslog]&lt;BR /&gt;
TRANSFORMS-changeindex=routeIndexbasedonhost, routeIndexbasedonevent&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;in transforms.conf&lt;/P&gt;

&lt;P&gt;`&lt;BR /&gt;
[routeIndexbasedonhost]&lt;BR /&gt;
SOURCE_KEY = MetaData:Host&lt;BR /&gt;
REGEX=(ftp|vpn)&lt;BR /&gt;
DEST_KEY=_MetaData:Index&lt;BR /&gt;
FORMAT=myindexB&lt;BR /&gt;
WRITE_META=true&lt;/P&gt;

&lt;P&gt;[routeIndexbasedonevent]&lt;BR /&gt;
REGEX=(AUDIT|ALERT)&lt;BR /&gt;
DEST_KEY=_MetaData:Index&lt;BR /&gt;
FORMAT=myindexC&lt;BR /&gt;
WRITE_META=true&lt;BR /&gt;
`&lt;/P&gt;

&lt;P&gt;The order of the transforms is important:&lt;BR /&gt;
TRANSFORMS-changeindex=routeIndexbasedonhost, routeIndexbasedonevent&lt;BR /&gt;
 will have : myindexA for all,  then some will become myindexB, and finally some will become myindexC&lt;BR /&gt;
so the last one will overwrite the previous ones.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:08:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-index-at-index-time/m-p/151574#M30844</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2020-09-28T17:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the index at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-index-at-index-time/m-p/151575#M30845</link>
      <description>&lt;P&gt;I would also ask why think you want to send them to different indexes? is it for security reasons? retention reasons?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2014 23:13:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-index-at-index-time/m-p/151575#M30845</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2014-07-21T23:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the index at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-index-at-index-time/m-p/151576#M30846</link>
      <description>&lt;P&gt;For retention mostly, the vpn logs are voluminous, and I want to keep only 1 month of them.&lt;BR /&gt;
But sometime for permissions, I want only my security team to be able to see the "ALERT" events.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jul 2014 16:31:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-index-at-index-time/m-p/151576#M30846</guid>
      <dc:creator>mataharry</dc:creator>
      <dc:date>2014-07-23T16:31:44Z</dc:date>
    </item>
  </channel>
</rss>

