<?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 How to use extract kvdelim and pairdelim to parse all key value pairs in my sample data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-extract-kvdelim-and-pairdelim-to-parse-all-key-value/m-p/263747#M79159</link>
    <description>&lt;P&gt;We have log entries similar to below and while I can write a regex expression to parse out all the kv pairs separated by a :, I wanted to know if there was a way I could use extract kvdelim to do the same.  Note that all the k:v pairs come AFTER the % expression.  In this case they also come after the = sign (Some logs do not have the = sign)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jan 5 18:21:49.817: %VOIPAAA-5-VOIP_FEAT_HISTORY: FEAT_VSA=fn:TWC,ft:01/05/2012 18:21:34.254,cgn:3333,cdn:1023,frs:0,fid:1013,fcid:EDD6080E370011E18A2BC77F1C86C06D,legID:455,bguid:EDD6080E370011E18A2BC77F1C86C06D
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm trying to do it via the search first before putting it into the transforms.conf so my search currently is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FEAT_HISTORY | extract pairdelim="=%",kvdelim=":"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but that doesn't work, it doesn't extract the k:v pairs in the above.  Is there a way I can get the above to work or should I just stick with the long regex expression I've created?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;ref 1:  &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Extract"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Extract&lt;/A&gt;&lt;BR /&gt;
ref 2:  &lt;A href="http://blogs.splunk.com/2008/02/12/delimiter-based-key-value-pair-extraction/"&gt;http://blogs.splunk.com/2008/02/12/delimiter-based-key-value-pair-extraction/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Mar 2016 18:54:00 GMT</pubDate>
    <dc:creator>reswob4</dc:creator>
    <dc:date>2016-03-29T18:54:00Z</dc:date>
    <item>
      <title>How to use extract kvdelim and pairdelim to parse all key value pairs in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-extract-kvdelim-and-pairdelim-to-parse-all-key-value/m-p/263747#M79159</link>
      <description>&lt;P&gt;We have log entries similar to below and while I can write a regex expression to parse out all the kv pairs separated by a :, I wanted to know if there was a way I could use extract kvdelim to do the same.  Note that all the k:v pairs come AFTER the % expression.  In this case they also come after the = sign (Some logs do not have the = sign)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jan 5 18:21:49.817: %VOIPAAA-5-VOIP_FEAT_HISTORY: FEAT_VSA=fn:TWC,ft:01/05/2012 18:21:34.254,cgn:3333,cdn:1023,frs:0,fid:1013,fcid:EDD6080E370011E18A2BC77F1C86C06D,legID:455,bguid:EDD6080E370011E18A2BC77F1C86C06D
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm trying to do it via the search first before putting it into the transforms.conf so my search currently is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FEAT_HISTORY | extract pairdelim="=%",kvdelim=":"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but that doesn't work, it doesn't extract the k:v pairs in the above.  Is there a way I can get the above to work or should I just stick with the long regex expression I've created?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;ref 1:  &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Extract"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Extract&lt;/A&gt;&lt;BR /&gt;
ref 2:  &lt;A href="http://blogs.splunk.com/2008/02/12/delimiter-based-key-value-pair-extraction/"&gt;http://blogs.splunk.com/2008/02/12/delimiter-based-key-value-pair-extraction/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 18:54:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-extract-kvdelim-and-pairdelim-to-parse-all-key-value/m-p/263747#M79159</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2016-03-29T18:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to use extract kvdelim and pairdelim to parse all key value pairs in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-extract-kvdelim-and-pairdelim-to-parse-all-key-value/m-p/263748#M79160</link>
      <description>&lt;P&gt;Hi, try this and let me know if helps:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count
| eval _raw = "Jan 5 18:21:49.817: %VOIPAAA-5-VOIP_FEAT_HISTORY: FEAT_VSA=fn:TWC,ft:01/05/2012 18:21:34.254,cgn:3333,cdn:1023,frs:0,fid:1013,fcid:EDD6080E370011E18A2BC77F1C86C06D,legID:455,bguid:EDD6080E370011E18A2BC77F1C86C06D"
| extract kvdelim=":" pairdelim=","
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is the output I'm getting:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FEAT_VSA    fn:TWC
bguid   EDD6080E370011E18A2BC77F1C86C06D
cdn     1023
cgn     3333
fcid    EDD6080E370011E18A2BC77F1C86C06D
fid     1013
frs     0
legID   455 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Mar 2016 19:01:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-extract-kvdelim-and-pairdelim-to-parse-all-key-value/m-p/263748#M79160</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-03-29T19:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use extract kvdelim and pairdelim to parse all key value pairs in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-extract-kvdelim-and-pairdelim-to-parse-all-key-value/m-p/263749#M79161</link>
      <description>&lt;P&gt;A: That was fast&lt;BR /&gt;
B: That worked&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 19:07:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-extract-kvdelim-and-pairdelim-to-parse-all-key-value/m-p/263749#M79161</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2016-03-29T19:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to use extract kvdelim and pairdelim to parse all key value pairs in my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-extract-kvdelim-and-pairdelim-to-parse-all-key-value/m-p/263750#M79162</link>
      <description>&lt;P&gt;I take it back a little:  It worked mostly.  It did not extract ft, where the time is stored.  probably because there are colons in the middle of that field.  I can regex that though.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 19:10:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-extract-kvdelim-and-pairdelim-to-parse-all-key-value/m-p/263750#M79162</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2016-03-29T19:10:07Z</dc:date>
    </item>
  </channel>
</rss>

