<?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 Rule based source typing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Rule-based-source-typing/m-p/125622#M25890</link>
    <description>&lt;P&gt;I'm trying to set the sourcetype on some events I get based on their contents, and then I want to send each of those differentiated sourcetypes to their own indexes. I've tried a bunch of different ways, and none of my approaches seem to work quite like the docs say they should. &lt;/P&gt;

&lt;P&gt;So, for starters, source typeing. I feel like what I'm trying to do is simple. If the string FlightEvent occurs anywhere in the event, it should be a FlightEvent. Flight and Event are actually separate xml opening tags, but I can't seem to get less-than and greater-than symbols to display in markdown. I don't know if that has any impact in props or transforms.conf.&lt;/P&gt;

&lt;P&gt;In props.conf&lt;/P&gt;

&lt;P&gt;[FlightEvent]&lt;BR /&gt;
TRANSFORMS-flighteventtrans = flighteventformat&lt;/P&gt;

&lt;P&gt;In transforms.conf&lt;/P&gt;

&lt;P&gt;[flighteventformat]&lt;BR /&gt;&lt;BR /&gt;
REGEX = FlightEvent&lt;BR /&gt;&lt;BR /&gt;
LOOKAHEAD = 16&lt;BR /&gt;&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;&lt;BR /&gt;
FORMAT = sourcetype:FlightEvent  &lt;/P&gt;

&lt;P&gt;No good.&lt;/P&gt;

&lt;P&gt;I tried setting up rule based source typing.&lt;/P&gt;

&lt;P&gt;In props.conf&lt;/P&gt;

&lt;P&gt;[rule::flighteventrule]&lt;BR /&gt;&lt;BR /&gt;
sourcetype=FlightEvent&lt;BR /&gt;&lt;BR /&gt;
MORE_THAN_1 = FlightEvent&lt;/P&gt;

&lt;P&gt;No good. I also can't get sourcetypes to go to the correct indexes, or actually any index other than main, but I guess I'll try to deal with that when I get source typing figured out.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 15:43:16 GMT</pubDate>
    <dc:creator>FaceF18</dc:creator>
    <dc:date>2020-09-28T15:43:16Z</dc:date>
    <item>
      <title>Rule based source typing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rule-based-source-typing/m-p/125622#M25890</link>
      <description>&lt;P&gt;I'm trying to set the sourcetype on some events I get based on their contents, and then I want to send each of those differentiated sourcetypes to their own indexes. I've tried a bunch of different ways, and none of my approaches seem to work quite like the docs say they should. &lt;/P&gt;

&lt;P&gt;So, for starters, source typeing. I feel like what I'm trying to do is simple. If the string FlightEvent occurs anywhere in the event, it should be a FlightEvent. Flight and Event are actually separate xml opening tags, but I can't seem to get less-than and greater-than symbols to display in markdown. I don't know if that has any impact in props or transforms.conf.&lt;/P&gt;

&lt;P&gt;In props.conf&lt;/P&gt;

&lt;P&gt;[FlightEvent]&lt;BR /&gt;
TRANSFORMS-flighteventtrans = flighteventformat&lt;/P&gt;

&lt;P&gt;In transforms.conf&lt;/P&gt;

&lt;P&gt;[flighteventformat]&lt;BR /&gt;&lt;BR /&gt;
REGEX = FlightEvent&lt;BR /&gt;&lt;BR /&gt;
LOOKAHEAD = 16&lt;BR /&gt;&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;&lt;BR /&gt;
FORMAT = sourcetype:FlightEvent  &lt;/P&gt;

&lt;P&gt;No good.&lt;/P&gt;

&lt;P&gt;I tried setting up rule based source typing.&lt;/P&gt;

&lt;P&gt;In props.conf&lt;/P&gt;

&lt;P&gt;[rule::flighteventrule]&lt;BR /&gt;&lt;BR /&gt;
sourcetype=FlightEvent&lt;BR /&gt;&lt;BR /&gt;
MORE_THAN_1 = FlightEvent&lt;/P&gt;

&lt;P&gt;No good. I also can't get sourcetypes to go to the correct indexes, or actually any index other than main, but I guess I'll try to deal with that when I get source typing figured out.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:43:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rule-based-source-typing/m-p/125622#M25890</guid>
      <dc:creator>FaceF18</dc:creator>
      <dc:date>2020-09-28T15:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rule based source typing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rule-based-source-typing/m-p/125623#M25891</link>
      <description>&lt;P&gt;The symbols &lt;CODE&gt;&amp;lt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;gt;&lt;/CODE&gt; are special characters in regular expressions. Also, your &lt;CODE&gt;props.conf&lt;/CODE&gt; has a problem - you are asking it to process events of sourcetype &lt;CODE&gt;FlightEvent&lt;/CODE&gt; - before you have assigned the sourcetype of &lt;CODE&gt;FlightEvent&lt;/CODE&gt;!!&lt;/P&gt;

&lt;P&gt;I suggest this in your &lt;CODE&gt;props.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::yourinputsourcefilehere]
TRANSFORMS-flighteventtrans = flighteventformat
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In &lt;CODE&gt;transforms.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[flighteventformat]
REGEX = \&amp;lt;Flight\&amp;gt;\&amp;lt;Event\&amp;gt;
LOOKAHEAD = 16
DEST_KEY = MetaData:Sourcetype
FORMAT = sourcetype:FlightEvent
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Skip the rule-based sourcetyping, you don't need it. Also the &lt;CODE&gt;REGEX&lt;/CODE&gt; above may be wrong, because I don't entirely understand the format of your events. If you could post a sample of the raw data (anonymized of course), that would be really helpful. If you paste it into the question, you can highlight it and then click on the &lt;CODE&gt;101&lt;/CODE&gt; icon to keep the markdown from messing with it.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jan 2014 07:00:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rule-based-source-typing/m-p/125623#M25891</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-01-25T07:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rule based source typing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rule-based-source-typing/m-p/125624#M25892</link>
      <description>&lt;P&gt;I get flight events from a number of different sources and hosts, so I'm not sure how to write the first statement so that it applies in this case. I tried both source and host * and .* with the hope that this would apply that transform to every event, and then I edited the regex to escape any special characters, and I still didn't have any luck.&lt;/P&gt;

&lt;P&gt;Also, I can't edit my post right now because every captcha is coming back invalid, but basically I want any event that has this substring "&lt;CODE&gt;&amp;lt;Flight&amp;gt;&amp;lt;Event&amp;gt;&lt;/CODE&gt;" in it anywhere to be set as a FlightEvent. Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 18:30:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rule-based-source-typing/m-p/125624#M25892</guid>
      <dc:creator>FaceF18</dc:creator>
      <dc:date>2014-01-27T18:30:59Z</dc:date>
    </item>
  </channel>
</rss>

