<?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: Extract key-value pairs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452355#M128086</link>
    <description>&lt;P&gt;If you are using "syslog" mechanism to send logs from untangle to Splunk, I would suggest using below mentioned SPL for field extraction&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="untangle" 
| rex "(?&amp;lt;json&amp;gt;\{.+)" | spath input=json | fields - json 
| replace /* with * in CClientAddr,CServerAddr,SClientAddr,SServerAddr,localAddr,remoteAddr
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 10 May 2019 04:31:11 GMT</pubDate>
    <dc:creator>sumanssah</dc:creator>
    <dc:date>2019-05-10T04:31:11Z</dc:date>
    <item>
      <title>Extract key-value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452352#M128083</link>
      <description>&lt;P&gt;I'm trying to extract the &lt;CODE&gt;key-value&lt;/CODE&gt; pairs from an &lt;CODE&gt;Untangle&lt;/CODE&gt; firewall log ( &lt;CODE&gt;syslog&lt;/CODE&gt; ), but the &lt;CODE&gt;Regex&lt;/CODE&gt; example I found on the forum don't work and I'm not even sure that's the best approach.&lt;BR /&gt;
Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;May  9 16:19:33 192.168.10.254 May  9 16:19:34 INFO  uvm[0]:  {"timeStamp":"2019-05-09 16:19:34.148","s2pBytes":0,"p2sBytes":0,"endTime":1557443974148,"sessionId":102006119003906,"tag":"uvm[0]: ","class":"class com.untangle.uvm.app.SessionStatsEvent","sessionEvent":{"entitled":true,"partitionTablePostfix":"_2019_05_09","hostname":"192.168.10.102","CServerPort":161,"protocol":17,"protocolName":"UDP","tag":"uvm[0]: ","localAddr":"/192.168.10.102","class":"class com.untangle.uvm.app.SessionEvent","SServerAddr":"/192.168.0.192","remoteAddr":"/192.168.0.192","serverIntf":100,"CClientAddr":"/192.168.10.102","serverCountry":"XU","sessionId":102006119003906,"SClientAddr":"/97.115.239.26","clientCountry":"XL","CClientPort":65181,"policyRuleId":0,"timeStamp":"2019-05-09 16:19:34.148","clientIntf":2,"policyId":1,"SClientPort":65181,"bypassed":false,"SServerPort":161,"CServerAddr":"/192.168.0.192","tagsString":""},"c2pBytes":0,"p2cBytes":0,"partitionTablePostfix":"_2019_05_09"}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 May 2019 23:31:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452352#M128083</guid>
      <dc:creator>scottkoontz57</dc:creator>
      <dc:date>2019-05-09T23:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extract key-value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452353#M128084</link>
      <description>&lt;P&gt;What is the regex you're using?&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 03:22:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452353#M128084</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-05-10T03:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Extract key-value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452354#M128085</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;"([^"]+)":"([^"]+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 May 2019 04:09:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452354#M128085</guid>
      <dc:creator>scottkoontz57</dc:creator>
      <dc:date>2019-05-10T04:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Extract key-value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452355#M128086</link>
      <description>&lt;P&gt;If you are using "syslog" mechanism to send logs from untangle to Splunk, I would suggest using below mentioned SPL for field extraction&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="untangle" 
| rex "(?&amp;lt;json&amp;gt;\{.+)" | spath input=json | fields - json 
| replace /* with * in CClientAddr,CServerAddr,SClientAddr,SServerAddr,localAddr,remoteAddr
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 May 2019 04:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452355#M128086</guid>
      <dc:creator>sumanssah</dc:creator>
      <dc:date>2019-05-10T04:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extract key-value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452356#M128087</link>
      <description>&lt;P&gt;Can you elaborate?  What exactly would I do with the code you provided?&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 14:15:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452356#M128087</guid>
      <dc:creator>scottkoontz57</dc:creator>
      <dc:date>2019-05-10T14:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extract key-value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452357#M128088</link>
      <description>&lt;P&gt;this will perform search time field extraction for untangle logs.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 13:08:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452357#M128088</guid>
      <dc:creator>sumanssah</dc:creator>
      <dc:date>2019-05-16T13:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Extract key-value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452358#M128089</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = "([^"]*)":(?:(?:{[^{}]+)}|(?:"?[^,"]*)"?)(?=$|,)
FORMAT = $1::$2
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See it work here:&lt;BR /&gt;
&lt;A href="https://regex101.com/r/9Iyyy9/1"&gt;https://regex101.com/r/9Iyyy9/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 00:44:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452358#M128089</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-03T00:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extract key-value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452359#M128090</link>
      <description>&lt;P&gt;Hello, use this. simple and powerful.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;My Log format   -&lt;/STRONG&gt;  |cb=hpot|et=2222|ip=x.x.x.x|action=acv|&lt;/P&gt;

&lt;P&gt;extract pairdelim="{|}" kvdelim="=" | table cb,et,ip,action               -----&amp;gt; Here pairdelim is | and kvdelim (keyvalue delim is &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;For your case, seems like  pairdelim is , and kvdelim is :&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 04:15:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452359#M128090</guid>
      <dc:creator>venkasplunk</dc:creator>
      <dc:date>2019-07-12T04:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Extract key-value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452360#M128091</link>
      <description>&lt;P&gt;intransforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_transform]
REGEX = "([^",{}]+)":"?([^",{}]+)"?
FORMAT = $1::$2
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;add the props to call it: REPORT-mytransform=mytransform.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2019 23:33:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-key-value-pairs/m-p/452360#M128091</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2019-07-13T23:33:09Z</dc:date>
    </item>
  </channel>
</rss>

