<?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: per event sourcetype override in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350600#M64342</link>
    <description>&lt;P&gt;thanks.  This means there is something missing. &lt;/P&gt;</description>
    <pubDate>Tue, 13 Mar 2018 14:14:03 GMT</pubDate>
    <dc:creator>ninisimonishvil</dc:creator>
    <dc:date>2018-03-13T14:14:03Z</dc:date>
    <item>
      <title>per event sourcetype override</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350598#M64340</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I have events that by default are assigned to syslog sourcetype. &lt;/P&gt;

&lt;P&gt;each of such event contains following sequence in it: Local7.Info 10.5.0.11 Feb 12 17:09:34 10.5.0.11 AlteonOS   (and other info). I decided that describing this sequence via regex will  identify those events that I would like to change a sourcetype for. &lt;/P&gt;

&lt;P&gt;So I created stanza in TRANSFORMS&lt;/P&gt;

&lt;P&gt;[sourcetypechange]&lt;BR /&gt;
REGEX = \d{2}-\d{2}-\d{2}-\d{4}\s\d{2}:\d{2}:\d{2}\s\Local7.Info\s\d*.\d*.\d*.\d*\s\w{3}\s\d{2}\s\d{2}:\d{2}:\d{2}\s\d*.\d*.\d*.\d*\s\w\lteonOS\s\&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;
FORMAT   = sourcetype::Redsyslog&lt;/P&gt;

&lt;P&gt;and also added following in PROPS&lt;/P&gt;

&lt;P&gt;[syslog]&lt;BR /&gt;
TRANSFORMS-sourcetype  = sourcetypechange&lt;/P&gt;

&lt;P&gt;As I understand, whenever splunk sees a syslog sourcetype - it has to check regex and if it matches it has to change sourcetype to Redsyslog, however I still have no result. &lt;/P&gt;

&lt;P&gt;I was wondering, while writing a REGEX, shall it describe the whole event (from the beginning to the end) or just part (which is my case) is sufficient?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:28:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350598#M64340</guid>
      <dc:creator>ninisimonishvil</dc:creator>
      <dc:date>2020-09-29T18:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: per event sourcetype override</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350599#M64341</link>
      <description>&lt;P&gt;The REGEX string only needs to match part of the event.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 14:10:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350599#M64341</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-03-13T14:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: per event sourcetype override</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350600#M64342</link>
      <description>&lt;P&gt;thanks.  This means there is something missing. &lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 14:14:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350600#M64342</guid>
      <dc:creator>ninisimonishvil</dc:creator>
      <dc:date>2018-03-13T14:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: per event sourcetype override</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350601#M64343</link>
      <description>&lt;P&gt;I believe you have a mistake here:&lt;/P&gt;

&lt;P&gt;SOURCE_KEY = _MetaData:Sourcetype&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 14:19:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350601#M64343</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-13T14:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: per event sourcetype override</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350602#M64344</link>
      <description>&lt;P&gt;You mean instead of DEST_KEY should be SOURCE_KEY? &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:26:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350602#M64344</guid>
      <dc:creator>ninisimonishvil</dc:creator>
      <dc:date>2020-09-29T18:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: per event sourcetype override</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350603#M64345</link>
      <description>&lt;P&gt;Sorry it was my mistake about the syntax, nothing wrong with yours.  Splunk applies the regex to the whole event. You should use a regex that uniquely identifies the kind of events you want to override Sourcertyoe. That is the criteria, a regex enoughly long and that let's your events be overridden.&lt;BR /&gt;
Are you sure your regex is capturing the events?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 07:58:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350603#M64345</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-14T07:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: per event sourcetype override</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350604#M64346</link>
      <description>&lt;P&gt;Well I check it at &lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt; and it highlight my event. Any suggestions where else I can check my regex?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 08:03:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350604#M64346</guid>
      <dc:creator>ninisimonishvil</dc:creator>
      <dc:date>2018-03-14T08:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: per event sourcetype override</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350605#M64347</link>
      <description>&lt;P&gt;Splunk uses Regex PCRE flavor of regular expressions, so anything that is PCRE-compliant is good to go. Did you make sure that was the flavor you were testing?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 08:10:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350605#M64347</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-14T08:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: per event sourcetype override</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350606#M64348</link>
      <description>&lt;P&gt;OK I think that was the issue, now  sourcetype changes. thanks a lot.  however,  now it does not do time extraction. &lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 09:07:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350606#M64348</guid>
      <dc:creator>ninisimonishvil</dc:creator>
      <dc:date>2018-03-14T09:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: per event sourcetype override</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350607#M64349</link>
      <description>&lt;P&gt;Ok good it is working. &lt;/P&gt;

&lt;P&gt;The time may be missing for two reasons. Is the timestamp written after the 128th character in the event (which is the default of the parameter MAX_TIMESTAMP_LOOKAHEAD). Increase the MAX_TIMESTAMP_LOOKAHEAD if it is the case.&lt;/P&gt;

&lt;P&gt;More, to make sure timestamp is recognised by Splunk, use the TIME_FORMAT parameter in the sourcetype definition (below the TRANSFORMS-sourcetype = sourcetypechange).&lt;/P&gt;

&lt;P&gt;TIME_FORMAT=%b %d %H:%M:%S&lt;/P&gt;

&lt;P&gt;For info on how the time variables work, &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/Commontimeformatvariables" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/Commontimeformatvariables&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT = &amp;lt;strptime-style format&amp;gt;
* Specifies a strptime format string to extract the date.
* strptime is an industry standard for designating time formats.
* For more information on strptime, see "Configure timestamp recognition" in
  the online documentation.
* TIME_FORMAT starts reading after the TIME_PREFIX. If both are specified,
  the TIME_PREFIX regex must match up to and including the character before
  the TIME_FORMAT date.
* For good results, the &amp;lt;strptime-style format&amp;gt; should describe the day of
  the year and the time of day.
* Defaults to empty.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:29:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350607#M64349</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2020-09-29T18:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: per event sourcetype override</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350608#M64350</link>
      <description>&lt;P&gt;well problem is the following.&lt;/P&gt;

&lt;P&gt;after assigning the new sourcetype, it shall break 1 event into several ones and also extract time as defined by regex. &lt;/P&gt;

&lt;P&gt;When I indicated that sourcetype upon uploading a file it works perfectly, breaks down event into several ones and extracts correct time stamp. however  when it comes to overriding, all the above mentioned points fail to work.&lt;/P&gt;

&lt;P&gt;[mysourcetype]&lt;BR /&gt;
pulldown_type = true&lt;BR /&gt;
maxDist = 3&lt;BR /&gt;
TIME_FORMAT = \d\d\/\d\d\/\d\d\d\d-\d\d:\d\d:\d\d&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 1500&lt;BR /&gt;
TRANSFORMS = syslog-host&lt;BR /&gt;
SHOULD_LINEMERGE = True&lt;BR /&gt;
category = Operating System&lt;BR /&gt;
BREAK_ONLY_BEFORE = |&lt;BR /&gt;
DATETIME_CONFIG = &lt;BR /&gt;
NO_BINARY_CHECK = true&lt;BR /&gt;
disabled = false&lt;BR /&gt;
TRANSFORMS-time1 = TIME&lt;BR /&gt;
TIME_PREFIX = p&lt;BR /&gt;
LINE_BREAKER = ()|&lt;BR /&gt;
KV_MODE = none&lt;/P&gt;

&lt;P&gt;and TIME from TRANSFORMS&lt;BR /&gt;
[TIME]&lt;BR /&gt;
REGEX=(?&amp;lt;=\w\w\w\s)(\d\d\/\d\d\/\d\d\d\d-\d\d:\d\d:\d\d)&lt;BR /&gt;
FORMAT=TIME::$1&lt;BR /&gt;
WRITE_META = True&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:26:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350608#M64350</guid>
      <dc:creator>ninisimonishvil</dc:creator>
      <dc:date>2020-09-29T18:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: per event sourcetype override</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350609#M64351</link>
      <description>&lt;P&gt;The reason is that sourcetype override occurs after timestamp recognition and breaking into events. It doesn't work the way you want, which is override Sourcertyoe and only then break into events&lt;/P&gt;

&lt;P&gt;It is expected behaviour. Each block only goes through the parsing pipeline once&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 11:21:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/per-event-sourcetype-override/m-p/350609#M64351</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-14T11:21:56Z</dc:date>
    </item>
  </channel>
</rss>

