<?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 classify events by source when they have the same sourcetpye? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36983#M8234</link>
    <description>&lt;P&gt;Without specifications, the FORMAT goes directly to the _raw field.&lt;/P&gt;

&lt;P&gt;But if you are using it to modify a metadata field (host, source, index, etc....) then you have to use the format&lt;BR /&gt;
source::mysource (for a static source)&lt;BR /&gt;
or in the case or a dynamic regex match&lt;/P&gt;

&lt;P&gt;REGEX=blahblah(mymatch)blahblah&lt;BR /&gt;
FORMAT=myfield::$1&lt;BR /&gt;
the $1 $2, etc will be the different matches in the Regex.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Apr 2012 14:58:00 GMT</pubDate>
    <dc:creator>yannK</dc:creator>
    <dc:date>2012-04-27T14:58:00Z</dc:date>
    <item>
      <title>how to classify events by source when they have the same sourcetpye?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36978#M8229</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I'm indexing a file which is being written by a syslog process (therefore I defined the sourcetype=syslog) and this has events from different sources(origins). However the events are very similar and I want to tell Splunk how to "tag" this events by source at index time. My problem is not separate the events to different indexes but rather just classify them as different sources using a regex.&lt;/P&gt;

&lt;P&gt;I have in &lt;STRONG&gt;inputs.conf&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///data/syslog_cache]
index = my_index
sourcetype = syslog
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I 'm thinking that I could do this in props.conf and transforms.conf but it doesn't work.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog]
EXTRACT-mySource1 = regex1
TRANSFORMS-set = myset1    
EXTRACT-mySource2 = regex2
TRANSFORMS-set = myset2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myset1]
source = mysource1

[myset2]
source = mysouce2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm probably confusing the goal behind this stanzas and attributes and I would appreciate any help.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2012 13:29:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36978#M8229</guid>
      <dc:creator>fernandoandre</dc:creator>
      <dc:date>2012-04-26T13:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to classify events by source when they have the same sourcetpye?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36979#M8230</link>
      <description>&lt;P&gt;Hi, it seems that you have the pieces, but in the wrong order.&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
[syslog]&lt;BR /&gt;
TRANSFORMS-set = myset1,myset2, myset3&lt;BR /&gt;
 # the transforms will apply in the order, and the last one can possibly replace the modifications from the previous ones.&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
[myset1]&lt;BR /&gt;
SOURCE_KEY = _raw&lt;BR /&gt;
 # optional, this is the default&lt;BR /&gt;
REGEX = &lt;YOUR_REGEX&gt;&lt;BR /&gt;
DEST_KEY = MetaData:Source&lt;BR /&gt;
FORMAT = source::$1&lt;BR /&gt;
 # beware the caps are important, no caps for "source" in format, initial cap for "Source" and "Metadata" in Dest_key&lt;/YOUR_REGEX&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;[myset2]&lt;BR /&gt;
 # etc...&lt;BR /&gt;
&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:44:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36979#M8230</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2020-09-28T11:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to classify events by source when they have the same sourcetpye?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36980#M8231</link>
      <description>&lt;P&gt;What's the specific role of "FORMAT = source::$1" ? Don't quite understand this part.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2012 13:40:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36980#M8231</guid>
      <dc:creator>fernandoandre</dc:creator>
      <dc:date>2012-04-27T13:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to classify events by source when they have the same sourcetpye?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36981#M8232</link>
      <description>&lt;P&gt;It's going to set the source based on the regex you provide.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2012 13:47:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36981#M8232</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2012-04-27T13:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to classify events by source when they have the same sourcetpye?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36982#M8233</link>
      <description>&lt;P&gt;I wasn't sure about "::$1" but nevermind.&lt;/P&gt;

&lt;P&gt;Good example. Thank you for your assistance.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2012 14:25:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36982#M8233</guid>
      <dc:creator>fernandoandre</dc:creator>
      <dc:date>2012-04-27T14:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to classify events by source when they have the same sourcetpye?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36983#M8234</link>
      <description>&lt;P&gt;Without specifications, the FORMAT goes directly to the _raw field.&lt;/P&gt;

&lt;P&gt;But if you are using it to modify a metadata field (host, source, index, etc....) then you have to use the format&lt;BR /&gt;
source::mysource (for a static source)&lt;BR /&gt;
or in the case or a dynamic regex match&lt;/P&gt;

&lt;P&gt;REGEX=blahblah(mymatch)blahblah&lt;BR /&gt;
FORMAT=myfield::$1&lt;BR /&gt;
the $1 $2, etc will be the different matches in the Regex.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2012 14:58:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-classify-events-by-source-when-they-have-the-same/m-p/36983#M8234</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-04-27T14:58:00Z</dc:date>
    </item>
  </channel>
</rss>

