<?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: simple index segregation ? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/simple-index-segregation/m-p/97684#M20366</link>
    <description>&lt;P&gt;Try the bottom two things first. (REGEX = . and underscores)&lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2013 16:57:06 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2013-04-17T16:57:06Z</dc:date>
    <item>
      <title>simple index segregation ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/simple-index-segregation/m-p/97681#M20363</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;

&lt;P&gt;I'm trying to find a quick and simple way to separate my incoming cisco syslogs into different indexes.  For complicated, and dull reasons we can only really use the udp:514 listener.&lt;/P&gt;

&lt;P&gt;The best I've come up with so far is defining a number of different transforms in the props.conf, then use regex to define which index they go to.   unfortunately my splunk and regex skills are currently rather weak and it's refusing to work.  &lt;/P&gt;

&lt;P&gt;So far I've got to here:&lt;BR /&gt;
~~ props.conf ~~&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog]
TRANSFORMS-routing = generic-routing, MPLS-routing, Office-routing
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;~~ transforms.conf ~~&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MPLS-routing]
SOURCE_KEY = MetaData:Host
REGEX = 10\.10\.\d+
DEST_KEY = _MetaData:Index
FORMAT = MPLS

[Office-routing]
SOURCE_KEY = MetaData:Host
REGEX = 10\.100\.\d+
DEST_KEY = _MetaData:Index
FORMAT = office

[generic-routing]
DEST_KEY = _MetaData:Index
FORMAT = syslog
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any tips or thoughts?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2013 13:35:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/simple-index-segregation/m-p/97681#M20363</guid>
      <dc:creator>Vtesse</dc:creator>
      <dc:date>2013-04-17T13:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: simple index segregation ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/simple-index-segregation/m-p/97682#M20364</link>
      <description>&lt;P&gt;One thing that could mess things up, and possibly be the source of your problems is that incoming syslog (i.e. with the &lt;CODE&gt;sourcetype&lt;/CODE&gt; set to &lt;CODE&gt;syslog&lt;/CODE&gt;) data goes through a &lt;CODE&gt;TRANSFORM&lt;/CODE&gt; for setting the host value based on the content of the events. Have a look at the &lt;CODE&gt;$SPLUNK_HOME/etc/system/default/props.conf&lt;/CODE&gt; and &lt;CODE&gt;transforms.conf&lt;/CODE&gt; to see how this works.&lt;/P&gt;

&lt;P&gt;If this happens before your &lt;CODE&gt;TRANSFORMS&lt;/CODE&gt; the host would not be there, or rather may not have the values you expect.&lt;/P&gt;

&lt;P&gt;You can skip the &lt;CODE&gt;SOURCE_KEY&lt;/CODE&gt; setting (default is the _raw event) and create your regexes to match a timestamp followed by &lt;CODE&gt;10.10.*&lt;/CODE&gt; or &lt;CODE&gt;10.100.*&lt;/CODE&gt; etc.&lt;/P&gt;

&lt;P&gt;Also, you may need to rename the the transforms so they use underscores instead of hyphens; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;generic_routing
MPLS_routing
Office_routing
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, you may have to specify a &lt;CODE&gt;REGEX = .&lt;/CODE&gt; for the &lt;CODE&gt;[generic_routing]&lt;/CODE&gt;. (see new spelling)&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2013 13:54:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/simple-index-segregation/m-p/97682#M20364</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-17T13:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: simple index segregation ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/simple-index-segregation/m-p/97683#M20365</link>
      <description>&lt;P&gt;Would it make more sense to use [source::udp] in the props.conf instead of [syslog] ?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2013 14:26:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/simple-index-segregation/m-p/97683#M20365</guid>
      <dc:creator>Vtesse</dc:creator>
      <dc:date>2013-04-17T14:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: simple index segregation ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/simple-index-segregation/m-p/97684#M20366</link>
      <description>&lt;P&gt;Try the bottom two things first. (REGEX = . and underscores)&lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2013 16:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/simple-index-segregation/m-p/97684#M20366</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-17T16:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: simple index segregation ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/simple-index-segregation/m-p/97685#M20367</link>
      <description>&lt;P&gt;apologies for not getting back to you, but I eventually got this working in a similar method to above.&lt;BR /&gt;
I ended up going for a [source::udp:514] thingy in props.conf then regex'ing in transforms as we discussed.&lt;BR /&gt;
the trick was, as usual, getting the regex to work.  ended up with the regex below to match the basic date/timestamp format of "MMM DD HH:MM:SS I{P OR Hostname}".  pretty simple stuff but invaluable nonetheless.&lt;/P&gt;

&lt;P&gt;[office_routing]&lt;BR /&gt;
REGEX = (\w+\ [0-9]{1,2}\ \d+:\d+:\d+ 10.100.[0-9]{1,3}.[0-9]{1,3})|(\w+.domain.ltd)&lt;BR /&gt;
DEST_KEY = _MetaData:Index&lt;BR /&gt;
FORMAT = office&lt;/P&gt;

&lt;P&gt;And it works perfectly&lt;BR /&gt;
thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:46:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/simple-index-segregation/m-p/97685#M20367</guid>
      <dc:creator>Vtesse</dc:creator>
      <dc:date>2020-09-28T13:46:28Z</dc:date>
    </item>
  </channel>
</rss>

