<?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 sourcetype from regex ignored. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/sourcetype-from-regex-ignored/m-p/153373#M31194</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I'm having trouble configuring my splunk.&lt;/P&gt;

&lt;P&gt;Indeed, i try to set sourcetype based on regex but, nothing works for me.&lt;BR /&gt;
The only sourcetype i get is "csv".&lt;/P&gt;

&lt;P&gt;My data comes from a file (csv.gz) and contains various type of log sources from various king of devices. I'd like to have for each type of event, a different sourcetype.&lt;/P&gt;

&lt;P&gt;In order to do so, i edited the props.conf and transform.conf regarding to the sample found on etc/system/default.&lt;/P&gt;

&lt;P&gt;For example: i try to have a sourcetype "Arkoon" for log coming from Arkoon Firewalls. Here's my transform and props configuration :&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Arkoon]

EXTRACT-arkoon-IP = fw\=(?P&amp;lt;fwname&amp;gt;[^\s]+) aktype\=(?P&amp;lt;arkoon_type&amp;gt;[^\s]+) ip_log_type\=(?P&amp;lt;ip_log_type&amp;gt;[^\s]+) src\=(?P&amp;lt;src&amp;gt;[^\s]+) dst\=(?P&amp;lt;dst&amp;gt;[^\s]+) proto\=\"\"(?P&amp;lt;proto&amp;gt;[^\"]+)

EXTRACT-fwname-arkoon_type-alert_type-user-alert_level-alert_desc = fw\=(?P&amp;lt;fwname&amp;gt;[^\s]+) aktype\=(?P&amp;lt;arkoon_type&amp;gt;[^\s]+) alert_type\=\"\"(?P&amp;lt;alert_type&amp;gt;[^\"]+)\"\" user\=\"\"(?P&amp;lt;user&amp;gt;[^\"]*)\"\" alert_level\=\"\"(?P&amp;lt;alert_level&amp;gt;[^\"]+)\"\" alert_desc\=\"\"(?P&amp;lt;alert_desc&amp;gt;.+)\"\"\"$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transform.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Arkoon-type]
REGEX = \sAKLOG\s
DEST_KEY = MetaData:Sourcetype
FORMAT = sourcetype::Arkoon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Here is a log sample that should match the regex:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;02/14/14 00:00:00,x.x.x.x_General,x.x.x.x,16,6,"&amp;lt;134&amp;gt;Feb 13 22:59:59 x.x.x.x IP-Logs: AKLOG - id=firewall time=""2014-02-13 22:59:59"" gmtime=1392332399 fw=firewall-arkoon aktype=IP ip_log_type=NEWCONN src=x.x.x.x dst=x.x.x.x proto=""https"" protocol=6 port_src=56863 port_dest=443 intf_in=eth0:vr1 intf_out=eth2-6:vr12 pkt_len=52 nat=NO snat_addr=0 snat_port=0 dnat_addr=0 dnat_port=0 tcp_seq=1861073959 tcp_ack=0 tcp_flags=""SYN"" user="""" vpn-src="""" pri=6 rule=""default_rule"" action=ACCEPT"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do i miss a file to edit ?&lt;/P&gt;

&lt;P&gt;Any help would be appreciated !&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 17 Feb 2014 17:27:46 GMT</pubDate>
    <dc:creator>cdherbigny</dc:creator>
    <dc:date>2014-02-17T17:27:46Z</dc:date>
    <item>
      <title>sourcetype from regex ignored.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/sourcetype-from-regex-ignored/m-p/153373#M31194</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I'm having trouble configuring my splunk.&lt;/P&gt;

&lt;P&gt;Indeed, i try to set sourcetype based on regex but, nothing works for me.&lt;BR /&gt;
The only sourcetype i get is "csv".&lt;/P&gt;

&lt;P&gt;My data comes from a file (csv.gz) and contains various type of log sources from various king of devices. I'd like to have for each type of event, a different sourcetype.&lt;/P&gt;

&lt;P&gt;In order to do so, i edited the props.conf and transform.conf regarding to the sample found on etc/system/default.&lt;/P&gt;

&lt;P&gt;For example: i try to have a sourcetype "Arkoon" for log coming from Arkoon Firewalls. Here's my transform and props configuration :&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Arkoon]

EXTRACT-arkoon-IP = fw\=(?P&amp;lt;fwname&amp;gt;[^\s]+) aktype\=(?P&amp;lt;arkoon_type&amp;gt;[^\s]+) ip_log_type\=(?P&amp;lt;ip_log_type&amp;gt;[^\s]+) src\=(?P&amp;lt;src&amp;gt;[^\s]+) dst\=(?P&amp;lt;dst&amp;gt;[^\s]+) proto\=\"\"(?P&amp;lt;proto&amp;gt;[^\"]+)

EXTRACT-fwname-arkoon_type-alert_type-user-alert_level-alert_desc = fw\=(?P&amp;lt;fwname&amp;gt;[^\s]+) aktype\=(?P&amp;lt;arkoon_type&amp;gt;[^\s]+) alert_type\=\"\"(?P&amp;lt;alert_type&amp;gt;[^\"]+)\"\" user\=\"\"(?P&amp;lt;user&amp;gt;[^\"]*)\"\" alert_level\=\"\"(?P&amp;lt;alert_level&amp;gt;[^\"]+)\"\" alert_desc\=\"\"(?P&amp;lt;alert_desc&amp;gt;.+)\"\"\"$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transform.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Arkoon-type]
REGEX = \sAKLOG\s
DEST_KEY = MetaData:Sourcetype
FORMAT = sourcetype::Arkoon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Here is a log sample that should match the regex:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;02/14/14 00:00:00,x.x.x.x_General,x.x.x.x,16,6,"&amp;lt;134&amp;gt;Feb 13 22:59:59 x.x.x.x IP-Logs: AKLOG - id=firewall time=""2014-02-13 22:59:59"" gmtime=1392332399 fw=firewall-arkoon aktype=IP ip_log_type=NEWCONN src=x.x.x.x dst=x.x.x.x proto=""https"" protocol=6 port_src=56863 port_dest=443 intf_in=eth0:vr1 intf_out=eth2-6:vr12 pkt_len=52 nat=NO snat_addr=0 snat_port=0 dnat_addr=0 dnat_port=0 tcp_seq=1861073959 tcp_ack=0 tcp_flags=""SYN"" user="""" vpn-src="""" pri=6 rule=""default_rule"" action=ACCEPT"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do i miss a file to edit ?&lt;/P&gt;

&lt;P&gt;Any help would be appreciated !&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2014 17:27:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/sourcetype-from-regex-ignored/m-p/153373#M31194</guid>
      <dc:creator>cdherbigny</dc:creator>
      <dc:date>2014-02-17T17:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: sourcetype from regex ignored.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/sourcetype-from-regex-ignored/m-p/153374#M31195</link>
      <description>&lt;P&gt;Ok, there are several issues here:&lt;/P&gt;

&lt;P&gt;1) don't edit files in 'default' folders, edit in 'local' instead.&lt;/P&gt;

&lt;P&gt;2) the file is called &lt;CODE&gt;transforms.conf&lt;/CODE&gt; not &lt;CODE&gt;transform.conf&lt;/CODE&gt; (but maybe that's just a typo)&lt;/P&gt;

&lt;P&gt;3) in order to activate a transform, it has to be invoked from &lt;CODE&gt;props.conf&lt;/CODE&gt;;&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your host, source or sourcetype]
TRANSFORMS-blah = setArkoon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setArkoon]
your REGEX, FORMAT, and DEST_KEY here (which look ok, by the way)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, out of habit I always recommend that you use underscores instead of hyphens in names. Splunk is picky sometimes.&lt;/P&gt;

&lt;P&gt;4) depending on how you get your data in, it might be possible to set the sourcetype in inputs.conf. You should look that up.&lt;/P&gt;

&lt;P&gt;5) As you've noticed, you base your field extractions on sourcetype (which is A Good Thing), so basically, &lt;STRONG&gt;the format of the events should dictate what calls for a new sourcetype&lt;/STRONG&gt;. Don't overdo it, e.g. create sourcetypes like arkoon_fw1, arkoon_fw2 etc, if the actual log format is the same.&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:54:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/sourcetype-from-regex-ignored/m-p/153374#M31195</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2020-09-28T15:54:32Z</dc:date>
    </item>
  </channel>
</rss>

