<?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: Key-value pair extraction in Security</title>
    <link>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21687#M734</link>
    <description>&lt;P&gt;I don't think you can use DELIMS to do this because as you've noted it doesn't work well when one of your delimiters shows up in a key or value field.  I had to solve this by using a REGEX instead, see: &lt;A href="http://splunk-base.splunk.com/answers/34550/help-with-regex-to-separate-keyvalue-pairs-with-a-character-sequence"&gt;http://splunk-base.splunk.com/answers/34550/help-with-regex-to-separate-keyvalue-pairs-with-a-character-sequence&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;in your case you would want to craft a regex that captures into two capture groups, group 1 is the key and group 2 is the value.&lt;BR /&gt;&lt;BR /&gt;
REGEX = To be created&lt;BR /&gt;
FORMAT = $1::$2&lt;/P&gt;

&lt;P&gt;i will try to figure out the regex, but my regex-fu is of a medium level so hopefully someone will beat me to it.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Nov 2011 17:30:18 GMT</pubDate>
    <dc:creator>tpsplunk</dc:creator>
    <dc:date>2011-11-23T17:30:18Z</dc:date>
    <item>
      <title>Key-value pair extraction</title>
      <link>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21686#M733</link>
      <description>&lt;P&gt;Given the event (output from Cisco ASA 'show vpn-sessiondb full svc' command)...&lt;/P&gt;

&lt;P&gt;Session ID: 33397 | EasyVPN: 0 | Username: &lt;A href="mailto:user@company.com"&gt;user@company.com&lt;/A&gt; | Group: VPN-User | Tunnel Group: WebVPN-AD-Authentication | IP Addr: 192.168.1.1 | Public IP: 184.151.1.1 | Protocol: Clientless SSL-Tunnel DTLS-Tunnel | License: SSL VPN | Session Subtype: With client | Encryption: RC4 AES128 | Login Time: 15:35:44 EST Tue Nov 22 2011 | Duration: 0h:00m:35s | Inactivity:  0h:00m:00s | Bytes Tx: 20277 | Bytes Rx: 19574 | NAC Result: Unknown | Posture Token:  | VLAN Mapping: N/A | VLAN:  0 ||&lt;/P&gt;

&lt;P&gt;... I am able to extract the key-value pairs using:&lt;/P&gt;

&lt;P&gt;**props.conf&lt;BR /&gt;
[vpnsessiondata]&lt;BR /&gt;&lt;BR /&gt;
DATETIME_CONFIG=CURRENT&lt;BR /&gt;&lt;BR /&gt;
REPORT-sessiondata=sessiondata&lt;/P&gt;

&lt;P&gt;**transforms.conf&lt;BR /&gt;&lt;BR /&gt;
[sessiondata]&lt;BR /&gt;&lt;BR /&gt;
DELIMS = "|", ":"&lt;/P&gt;

&lt;P&gt;The problem during searches is that a field is ignored if the character delimiting the key from the value (":" in this case) is also contained within the value (any time value for instance).&lt;/P&gt;

&lt;P&gt;How can I deal with this?&lt;/P&gt;

&lt;P&gt;Thanks!  Jeff&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2011 16:42:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21686#M733</guid>
      <dc:creator>jkloet</dc:creator>
      <dc:date>2011-11-23T16:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Key-value pair extraction</title>
      <link>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21687#M734</link>
      <description>&lt;P&gt;I don't think you can use DELIMS to do this because as you've noted it doesn't work well when one of your delimiters shows up in a key or value field.  I had to solve this by using a REGEX instead, see: &lt;A href="http://splunk-base.splunk.com/answers/34550/help-with-regex-to-separate-keyvalue-pairs-with-a-character-sequence"&gt;http://splunk-base.splunk.com/answers/34550/help-with-regex-to-separate-keyvalue-pairs-with-a-character-sequence&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;in your case you would want to craft a regex that captures into two capture groups, group 1 is the key and group 2 is the value.&lt;BR /&gt;&lt;BR /&gt;
REGEX = To be created&lt;BR /&gt;
FORMAT = $1::$2&lt;/P&gt;

&lt;P&gt;i will try to figure out the regex, but my regex-fu is of a medium level so hopefully someone will beat me to it.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2011 17:30:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21687#M734</guid>
      <dc:creator>tpsplunk</dc:creator>
      <dc:date>2011-11-23T17:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Key-value pair extraction</title>
      <link>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21688#M735</link>
      <description>&lt;P&gt;Not sure whether this will work, but give it a try.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;transforms.conf&lt;BR /&gt;
[sessiondata]&lt;BR /&gt;
DELIMS = "|", ": "&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Notice the space after &lt;CODE&gt;:&lt;/CODE&gt; in &lt;CODE&gt;DELIMS&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;gt; please upvote and accept answer if you find it useful - thanks!&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2011 17:35:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21688#M735</guid>
      <dc:creator>_d_</dc:creator>
      <dc:date>2011-11-23T17:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Key-value pair extraction</title>
      <link>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21689#M736</link>
      <description>&lt;P&gt;That would be nice however the documentation says:&lt;/P&gt;

&lt;P&gt;[multiple_delims]&lt;BR /&gt;
DELIMS = "|;", "=:"&lt;/P&gt;

&lt;P&gt;*The above example extracts key-value pairs which are separated by '|' or ';'.&lt;BR /&gt;
*while the key is delimited from value by '=' or ':'.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2011 17:47:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21689#M736</guid>
      <dc:creator>jkloet</dc:creator>
      <dc:date>2011-11-23T17:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Key-value pair extraction</title>
      <link>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21690#M737</link>
      <description>&lt;P&gt;OK, in that case then try something like this using your transforms stanza:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;transforms.conf &lt;BR /&gt;
[sessiondata] &lt;BR /&gt;
REGEX = ([^\|]+):\s([^\|]+)&lt;BR /&gt;
FORMAT = $1::$2&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;REGEX reads "anything that is not a pipe, followed by a colon, followed by a space, followed by a pipe, followed by anything that is not a pipe.&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;gt; please upvote and accept answer if you find it useful - thanks!&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2011 18:04:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21690#M737</guid>
      <dc:creator>_d_</dc:creator>
      <dc:date>2011-11-23T18:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Key-value pair extraction</title>
      <link>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21691#M738</link>
      <description>&lt;P&gt;That works as needed... thanks!!  Jeff&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2011 18:40:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Key-value-pair-extraction/m-p/21691#M738</guid>
      <dc:creator>jkloet</dc:creator>
      <dc:date>2011-11-23T18:40:09Z</dc:date>
    </item>
  </channel>
</rss>

