<?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 can I override source type? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327546#M97505</link>
    <description>&lt;P&gt;Hi ninisimonishvili,&lt;BR /&gt;
if you put &lt;CODE&gt;[syslog3.txt]&lt;/CODE&gt; in a props.conf stanza, Splunk takes it as a sourcetype.&lt;BR /&gt;
You should use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::&amp;lt;source&amp;gt;]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;using the full path of your source&lt;/P&gt;

&lt;P&gt;See &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.2/Admin/Propsconf"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.2/Admin/Propsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 02 Mar 2018 13:29:53 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2018-03-02T13:29:53Z</dc:date>
    <item>
      <title>How can I override source type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327545#M97504</link>
      <description>&lt;P&gt;Hello &lt;/P&gt;

&lt;P&gt;I have an event  that starts like this:&lt;/P&gt;

&lt;P&gt;02-12-2018  17:07:33       Local7.Info   10.5.0.11      Feb 12 17:07:32 10.5.0.11  AlteonOS :&lt;/P&gt;

&lt;P&gt;10.5.0.1 58696 10.5.0.101 80 tcp 12/02/2018-17:07:10 12/02/2018-17:07:11 10.6.0.101 80 0.0.0.0 2060 |&lt;/P&gt;

&lt;P&gt;10.5.0.1 58697 10.5.0.101 80 tcp 12/02/2018-17:07:10 12/02/2018-17:07:11 10.6.0.101 80 0.0.0.0 2075 |&lt;/P&gt;

&lt;P&gt;I want to override the sourcetype while indexing. Here are my transforms and props file contents:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Transforms:&lt;/STRONG&gt;&lt;BR /&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;&lt;STRONG&gt;Props&lt;/STRONG&gt;&lt;BR /&gt;
[syslog3.txt]&lt;BR /&gt;
TRANSFORMS-sourcetype  = sourcetypechange&lt;/P&gt;

&lt;P&gt;syslog3.txt is a source,  I upload it to test if there are changes in sourcetype, no success. Can anyone tell me if I'm doing anything wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:17:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327545#M97504</guid>
      <dc:creator>ninisimonishvil</dc:creator>
      <dc:date>2020-09-29T18:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I override source type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327546#M97505</link>
      <description>&lt;P&gt;Hi ninisimonishvili,&lt;BR /&gt;
if you put &lt;CODE&gt;[syslog3.txt]&lt;/CODE&gt; in a props.conf stanza, Splunk takes it as a sourcetype.&lt;BR /&gt;
You should use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::&amp;lt;source&amp;gt;]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;using the full path of your source&lt;/P&gt;

&lt;P&gt;See &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.2/Admin/Propsconf"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.2/Admin/Propsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 13:29:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327546#M97505</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-03-02T13:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I override source type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327547#M97506</link>
      <description>&lt;P&gt;Thank you Giuseppe, &lt;/P&gt;

&lt;P&gt;I tried indicating full path (also used sourcetype instead of source) however no success. &lt;BR /&gt;
The regex that I'm using in Transforms -  shall it describe the whole event or just the beginning?&lt;BR /&gt;&lt;BR /&gt;
because the start of the event will follow this sequence&lt;BR /&gt;
 : 02-12-2018 17:07:33 Local7.Info 10.5.0.11 Feb 12 17:07:32 10.5.0.11 AlteonOS :&lt;BR /&gt;&lt;BR /&gt;
however, the number of followed IP addresses and timestamps may vary from event to event. &lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 06:33:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327547#M97506</guid>
      <dc:creator>ninisimonishvil</dc:creator>
      <dc:date>2018-03-05T06:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I override source type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327548#M97507</link>
      <description>&lt;P&gt;Hi ninisimonishvili,&lt;BR /&gt;
the regex to find could be in every part of your event: you can verify it in Splunk using the rex command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index | rex "my_regex"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in this way you should have as results the event to discard.&lt;/P&gt;

&lt;P&gt;The job is to find (if exist) the correct regex to find all the events to discard: you could also think to use more than one regex, anyway the method is the one above: use rex command in Splunk search, eventually more than one.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 07:34:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327548#M97507</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-03-05T07:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can I override source type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327549#M97508</link>
      <description>&lt;P&gt;Hi ninisimonishvili,&lt;BR /&gt;
How your full path stanza looks now? &lt;/P&gt;

&lt;P&gt;Also could you please explain why you choose this solution? Do you have different sourcetypes in one dataflow? Or maybe you can't change it at monitor stanza level? &lt;/P&gt;

&lt;P&gt;If you need only to rename existing sourcetype, you could do that by using splunk sourcetype rename feature. &lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.2/Data/Renamesourcetypes"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.2/Data/Renamesourcetypes&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Please keep in ming that REGEX can put some overhead to indexer depending on EPS.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 08:06:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327549#M97508</guid>
      <dc:creator>serjandrosov</dc:creator>
      <dc:date>2018-03-05T08:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can I override source type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327550#M97509</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;to clarify, I need to change sourcetype in order to make some field and correct timestamp extraction, however I need to make these extraction not for all the event from a particular sourcetpe, that is why I'm describing sequence of event via regex where I need to change sourcetype. &lt;/P&gt;

&lt;P&gt;now I'm just testing the syntax via test.txt file. keep uploading it after conf file alterations and restart. however getting no results. &lt;/P&gt;

&lt;P&gt;here are the conf file configurations:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;PROPS&lt;/STRONG&gt;&lt;BR /&gt;
[source::C:\Users\Administrator\Desktop\test.txt]&lt;BR /&gt;
TRANSFORMS-sourcetype  = sourcetypechange&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;TRANSFORMS&lt;/STRONG&gt;&lt;BR /&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;I checked regex and it is fine. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:18:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327550#M97509</guid>
      <dc:creator>ninisimonishvil</dc:creator>
      <dc:date>2020-09-29T18:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I override source type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327551#M97510</link>
      <description>&lt;P&gt;&lt;STRONG&gt;PROPS&lt;/STRONG&gt;&lt;BR /&gt;
[source::C:\Users\Administrator\Desktop\test.txt]&lt;BR /&gt;
TRANSFORMS-sourcetype  = sourcetypechange&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;TRANSFORMS&lt;/STRONG&gt;&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;I'm changing sourcetype because need to to some field and timestamp extractions however not for all events, but only for those that start with : 02-02-12-2018 17:07:33 Local7.Info 10.5.0.11 Feb 12 17:09:32 10.5.0.11 AlteonOS &lt;/P&gt;

&lt;P&gt;I'm using test.txt file to test if the sourcetype override works (I keep uploading it after every change, and keep restarting splunk). No result so far. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:18:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327551#M97510</guid>
      <dc:creator>ninisimonishvil</dc:creator>
      <dc:date>2020-09-29T18:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can I override source type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327552#M97511</link>
      <description>&lt;P&gt;Regarding &lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.2/Admin/Propsconf"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.2/Admin/Propsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Considerations for Windows file paths:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;When you specify Windows-based file paths as part of a [source::] stanza, you must escape any backslashes contained within the specified file path.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Example: [source::c:\path_to\file.txt]&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 13:22:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-override-source-type/m-p/327552#M97511</guid>
      <dc:creator>serjandrosov</dc:creator>
      <dc:date>2018-03-05T13:22:57Z</dc:date>
    </item>
  </channel>
</rss>

