<?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: Error with regex for syslog event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Error-with-regex-for-syslog-event/m-p/24096#M4372</link>
    <description>&lt;P&gt;I'm not sure you can mix-and match numbered group-based extraction with splunk's advanced regex (e.g. &lt;CODE&gt;[[bc_url]]&lt;/CODE&gt;)&lt;/P&gt;

&lt;P&gt;Perhaps this would work if you used named groups.  You could try using a &lt;CODE&gt;tranforms.props&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;BTW, you don't want to override the "host" field like this.  If you want to explicitly set the "host" value that get's indexed, you should do it with a special index-time transformer.&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Hughes_TPS_host]
#Feb 10 13:40:24 066.082.009.081
DEST_KEY = MetaData:Host
REGEX    = ^.*[^\:]*\d\d\:\d\d\:\d\d[^\:]*?\s(\d+\.\d+\.\d+\.\d+)\s
FORMAT   = host::$1

[Hughes_TPS]
#Feb 10 13:40:24 066.082.009.081 TPS,1,HN-IP,67.143.66.109,PC-IP,67.143.66.110,OUT,0,IN,0,update.intervideo.com:80,http://update.intervideo.com/Ping.asp
REGEX = ^.*[^\:]*\d\d\:\d\d\:\d\d[^\:]*?\s\d+\.\d+\.\d+\.\d+\s[^,]+,(?P&amp;lt;record_type&amp;gt;[^,]+),HN-IP,(?P&amp;lt;hn_ip&amp;gt;[^,]+),PC-IP,(?P&amp;lt;pc_ip&amp;gt;[^,]+),OUT,(?P&amp;lt;bytes_out&amp;gt;[^,]+),IN,(?P&amp;lt;bytes_in&amp;gt;[^,]+),(?P&amp;lt;domain&amp;gt;[^,]+),(?P&amp;lt;url&amp;gt;.+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you get the entry above to work, then try using the fancy combo splunk regex thing....&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Hughes_TPS]
#Feb 10 13:40:24 066.082.009.081 TPS,1,HN-IP,67.143.66.109,PC-IP,67.143.66.110,OUT,0,IN,0,update.intervideo.com:80,http://update.intervideo.com/Ping.asp
REGEX = ^.*[^\:]*\d\d\:\d\d\:\d\d[^\:]*?\s\d+\.\d+\.\d+\.\d+\s[^,]+,(?P&amp;lt;record_type&amp;gt;[^,]+),HN-IP,(?P&amp;lt;hn_ip&amp;gt;[^,]+),PC-IP,(?P&amp;lt;pc_ip&amp;gt;[^,]+),OUT,(?P&amp;lt;bytes_out&amp;gt;[^,]+),IN,(?P&amp;lt;bytes_in&amp;gt;[^,]+),(?P&amp;lt;domain&amp;gt;[^,]+),[[bc_uri]]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your &lt;CODE&gt;props.conf&lt;/CODE&gt; should probably look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host::192.168.10]
sourcetype = HughesTPS

[HughesTPS]
KV_MODE = none
TRANSFORM-host = Hughes_TPS_host
REPORT-syslog = Hughes_TPS
# I wouldn't recommend messing with segmentation unless you're and advanced user.
# SEGMENTATION = inner
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 03 Aug 2010 04:52:08 GMT</pubDate>
    <dc:creator>Lowell</dc:creator>
    <dc:date>2010-08-03T04:52:08Z</dc:date>
    <item>
      <title>Error with regex for syslog event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-with-regex-for-syslog-event/m-p/24095#M4371</link>
      <description>&lt;P&gt;Running splunk on windows2003. I am getting the events but it seems my regex is not working right on the event. &lt;/P&gt;

&lt;P&gt;Sample syslog event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Feb 10 13:40:24 066.082.009.081 TPS,1,HN-IP,67.143.66.109,PC-IP,67.143.66.110,OUT,0,IN,0,update.intervideo.com:80,http://update.intervideo.com/Ping.asp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should be converted to the following fields&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FORMAT = host::$1 record_type::$2 hn_ip::$3 pc_ip::$4 bytes_out::$5 bytes_in::$6 domain::$7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However it is not working.. could someone give me a clue as to whats wrong with the regex ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = ^.*[^\:]*\d\d\:\d\d\:\d\d[^\:]*?\s(\d+\.\d+\.\d+\.\d+)\s[^,]+,([^,]+),HN-IP,([^,]+),PC-IP,([^,]+),OUT,([^,]+),IN,([^,]+),([^,]+),[[bc_uri]]

[Hughes_TPS]
#Feb 10 13:40:24 066.082.009.081 TPS,1,HN-IP,67.143.66.109,PC-IP,67.143.66.110,OUT,0,IN,0,update.intervideo.com:80,http://update.intervideo.com/Ping.asp
REGEX = ^.*[^\:]*\d\d\:\d\d\:\d\d[^\:]*?\s(\d+\.\d+\.\d+\.\d+)\s[^,]+,([^,]+),HN-IP,([^,]+),PC-IP,([^,]+),OUT,([^,]+),IN,([^,]+),([^,]+),[[bc_uri]]
FORMAT = host::$1 record_type::$2 hn_ip::$3 pc_ip::$4 bytes_out::$5 bytes_in::$6 domain::$7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[udp://514]
sourcetype = syslog
no_appending_timestamp = true

[host::192.168.10:81]
sourcetype = HughesTPS
KV_MODE = none
REPORT-syslog = Hughes_TPS
SEGMENTATION = inner
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Aug 2010 00:13:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-with-regex-for-syslog-event/m-p/24095#M4371</guid>
      <dc:creator>kseshadri</dc:creator>
      <dc:date>2010-08-03T00:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error with regex for syslog event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-with-regex-for-syslog-event/m-p/24096#M4372</link>
      <description>&lt;P&gt;I'm not sure you can mix-and match numbered group-based extraction with splunk's advanced regex (e.g. &lt;CODE&gt;[[bc_url]]&lt;/CODE&gt;)&lt;/P&gt;

&lt;P&gt;Perhaps this would work if you used named groups.  You could try using a &lt;CODE&gt;tranforms.props&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;BTW, you don't want to override the "host" field like this.  If you want to explicitly set the "host" value that get's indexed, you should do it with a special index-time transformer.&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Hughes_TPS_host]
#Feb 10 13:40:24 066.082.009.081
DEST_KEY = MetaData:Host
REGEX    = ^.*[^\:]*\d\d\:\d\d\:\d\d[^\:]*?\s(\d+\.\d+\.\d+\.\d+)\s
FORMAT   = host::$1

[Hughes_TPS]
#Feb 10 13:40:24 066.082.009.081 TPS,1,HN-IP,67.143.66.109,PC-IP,67.143.66.110,OUT,0,IN,0,update.intervideo.com:80,http://update.intervideo.com/Ping.asp
REGEX = ^.*[^\:]*\d\d\:\d\d\:\d\d[^\:]*?\s\d+\.\d+\.\d+\.\d+\s[^,]+,(?P&amp;lt;record_type&amp;gt;[^,]+),HN-IP,(?P&amp;lt;hn_ip&amp;gt;[^,]+),PC-IP,(?P&amp;lt;pc_ip&amp;gt;[^,]+),OUT,(?P&amp;lt;bytes_out&amp;gt;[^,]+),IN,(?P&amp;lt;bytes_in&amp;gt;[^,]+),(?P&amp;lt;domain&amp;gt;[^,]+),(?P&amp;lt;url&amp;gt;.+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you get the entry above to work, then try using the fancy combo splunk regex thing....&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Hughes_TPS]
#Feb 10 13:40:24 066.082.009.081 TPS,1,HN-IP,67.143.66.109,PC-IP,67.143.66.110,OUT,0,IN,0,update.intervideo.com:80,http://update.intervideo.com/Ping.asp
REGEX = ^.*[^\:]*\d\d\:\d\d\:\d\d[^\:]*?\s\d+\.\d+\.\d+\.\d+\s[^,]+,(?P&amp;lt;record_type&amp;gt;[^,]+),HN-IP,(?P&amp;lt;hn_ip&amp;gt;[^,]+),PC-IP,(?P&amp;lt;pc_ip&amp;gt;[^,]+),OUT,(?P&amp;lt;bytes_out&amp;gt;[^,]+),IN,(?P&amp;lt;bytes_in&amp;gt;[^,]+),(?P&amp;lt;domain&amp;gt;[^,]+),[[bc_uri]]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your &lt;CODE&gt;props.conf&lt;/CODE&gt; should probably look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host::192.168.10]
sourcetype = HughesTPS

[HughesTPS]
KV_MODE = none
TRANSFORM-host = Hughes_TPS_host
REPORT-syslog = Hughes_TPS
# I wouldn't recommend messing with segmentation unless you're and advanced user.
# SEGMENTATION = inner
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Aug 2010 04:52:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-with-regex-for-syslog-event/m-p/24096#M4372</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-08-03T04:52:08Z</dc:date>
    </item>
  </channel>
</rss>

