<?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: Using kv or extract ain't working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-kv-or-extract-ain-t-working/m-p/101273#M26170</link>
    <description>&lt;P&gt;The key-value extraction works best when every field is set to the key=value pair. For instance the server name is not in a kv pair so this might be why it is not working. I would recommend that you just build the fields using rex, erex or the field extractor. &lt;/P&gt;

&lt;P&gt;Here is a quick shot at the regular expression to build the fields:&lt;/P&gt;

&lt;P&gt;sourcetype=sidewinder | rex field=_raw "\s+srcip:\s+(?&lt;SRCIP&gt;\S+)\s+" | table _time, srcip&lt;/SRCIP&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jul 2013 19:42:04 GMT</pubDate>
    <dc:creator>tgow</dc:creator>
    <dc:date>2013-07-19T19:42:04Z</dc:date>
    <item>
      <title>Using kv or extract ain't working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-kv-or-extract-ain-t-working/m-p/101272#M26169</link>
      <description>&lt;P&gt;I have a McAfee Firewall Appliance log (Sidewinder for those of us familiar with the tool) that comes to Splunk by way of syslog and I'm trying to extract k/v from the log.  Here's an example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-07-19T12:31:41-04:00 Firewall_host auditd: 2013-07-19 16:31:41 +0000 f_ntp_daemon a_server t_netprobe p_major pid: 24912 logid: 0 cmd: 'ntpd' hostname: Firewall_host.fq.dn event: probe attempt srcip: 0.0.0.0 srcport: 123 srczone: internal protocol: 17 dstip: 0.0.0.0 dstport: 123 attackip: 0.0.0.0 attackzone: internal reason: Received a connection attempt destined for a service that the current policy does not support.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can't figure out what to use as the pairdelim and kvdelim values.  I've tried &lt;CODE&gt;pairdelim=" ", kvdelim=":"; pairdelim="p_major ", kvdelim=":"; pairdelim="p_major\s", kvdelim=":\s"&lt;/CODE&gt;--and every variation in between.  Usually I'll place a &lt;CODE&gt;'| table, srcip'&lt;/CODE&gt; on the end to see if it extracts the fields, but no such luck.&lt;/P&gt;

&lt;P&gt;-Josh&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2013 18:39:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-kv-or-extract-ain-t-working/m-p/101272#M26169</guid>
      <dc:creator>joshua_hart</dc:creator>
      <dc:date>2013-07-19T18:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using kv or extract ain't working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-kv-or-extract-ain-t-working/m-p/101273#M26170</link>
      <description>&lt;P&gt;The key-value extraction works best when every field is set to the key=value pair. For instance the server name is not in a kv pair so this might be why it is not working. I would recommend that you just build the fields using rex, erex or the field extractor. &lt;/P&gt;

&lt;P&gt;Here is a quick shot at the regular expression to build the fields:&lt;/P&gt;

&lt;P&gt;sourcetype=sidewinder | rex field=_raw "\s+srcip:\s+(?&lt;SRCIP&gt;\S+)\s+" | table _time, srcip&lt;/SRCIP&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2013 19:42:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-kv-or-extract-ain-t-working/m-p/101273#M26170</guid>
      <dc:creator>tgow</dc:creator>
      <dc:date>2013-07-19T19:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using kv or extract ain't working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-kv-or-extract-ain-t-working/m-p/101274#M26171</link>
      <description>&lt;P&gt;Unfortunatly since there is nto constant delime you will have to use regex,  I recommend doing so in a transform.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2013 21:47:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-kv-or-extract-ain-t-working/m-p/101274#M26171</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2013-07-19T21:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using kv or extract ain't working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-kv-or-extract-ain-t-working/m-p/101275#M26172</link>
      <description>&lt;P&gt;I'll give that a try when I get in to work on Monday.  Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 10 Aug 2013 00:09:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-kv-or-extract-ain-t-working/m-p/101275#M26172</guid>
      <dc:creator>joshua_hart</dc:creator>
      <dc:date>2013-08-10T00:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using kv or extract ain't working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-kv-or-extract-ain-t-working/m-p/101276#M26173</link>
      <description>&lt;P&gt;I was able to extract all the fields using rex expressions.  Now, how do I translate that into a permanent thing?  I tried adding EXTRACT expressions to a props.conf file that is present on my HF, and SH systems, but when I search for that sourcetype, none of the fields are present in the field list.  I'm using the same regexes in props.conf as I am in the rex search.  Search is below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=sidewinder | rex field=_raw "\s+reason:\s+(?&amp;lt;reason&amp;gt;.+)$" | rex field=_raw "\spid:\s+(?&amp;lt;pid&amp;gt;\S+)\s" | rex field=_raw "\slogid:\s+(?&amp;lt;logid&amp;gt;\S+)\s" | rex field=_raw "\scmd:\s+(?&amp;lt;cmd&amp;gt;\S+)\s" | rex field=_raw "\shostname:\s+(?&amp;lt;hostname&amp;gt;\S+)\s" | rex field=_raw "\sevent:\s+(?&amp;lt;event&amp;gt;\S+)\s" | rex field=_raw "\ssrcip:\s+(?&amp;lt;srcip&amp;gt;\S+)\s" | rex field=_raw "\ssrcport:\s+(?&amp;lt;srcport&amp;gt;\S+)\s" | rex field=_raw "\ssrczone:\s+(?&amp;lt;srczone&amp;gt;\S+)\s" | rex field=_raw "\sdstip:\s+(?&amp;lt;dstip&amp;gt;\S+)\s" | rex field=_raw "\sdstport:\s+(?&amp;lt;dstport&amp;gt;\S+)\s" | rex field=_raw "\sdstzone:\s+(?&amp;lt;dstzone&amp;gt;\S+)\s" | rex field=_raw "\sattackip:\s+(?&amp;lt;attackip&amp;gt;\S+)\s" | rex field=_raw "\sattackzone:\s+(?&amp;lt;attackzone&amp;gt;\S+)\s"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Aug 2013 13:10:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-kv-or-extract-ain-t-working/m-p/101276#M26173</guid>
      <dc:creator>joshua_hart</dc:creator>
      <dc:date>2013-08-12T13:10:17Z</dc:date>
    </item>
  </channel>
</rss>

