<?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 extract a list of quoted key value pairs when some values have spaces? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-list-of-quoted-key-value-pairs-when-some-values/m-p/419825#M120709</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am attempting to figure out how to extract the following example event for all fields (the real event has ~30 fields but these show all use cases).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{'start_time': '2019-07-30 15:19:20', 'duration': '2', 'ip': '192.168.1.1', 'mac': '00:00:00:00:00:00', 'source': 'open source'}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I started my attempts with delimiters I found through some googling,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;transforms.conf
[my_sourcetype]
DELIMS = "\"{,}", ": "
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With this in place the event would have duration and IP extracted, but not mac, source, or start_time. &lt;/P&gt;

&lt;P&gt;Any help is appreciated. &lt;/P&gt;</description>
    <pubDate>Wed, 31 Jul 2019 18:55:28 GMT</pubDate>
    <dc:creator>prcough</dc:creator>
    <dc:date>2019-07-31T18:55:28Z</dc:date>
    <item>
      <title>How to extract a list of quoted key value pairs when some values have spaces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-list-of-quoted-key-value-pairs-when-some-values/m-p/419825#M120709</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am attempting to figure out how to extract the following example event for all fields (the real event has ~30 fields but these show all use cases).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{'start_time': '2019-07-30 15:19:20', 'duration': '2', 'ip': '192.168.1.1', 'mac': '00:00:00:00:00:00', 'source': 'open source'}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I started my attempts with delimiters I found through some googling,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;transforms.conf
[my_sourcetype]
DELIMS = "\"{,}", ": "
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With this in place the event would have duration and IP extracted, but not mac, source, or start_time. &lt;/P&gt;

&lt;P&gt;Any help is appreciated. &lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 18:55:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-list-of-quoted-key-value-pairs-when-some-values/m-p/419825#M120709</guid>
      <dc:creator>prcough</dc:creator>
      <dc:date>2019-07-31T18:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a list of quoted key value pairs when some values have spaces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-list-of-quoted-key-value-pairs-when-some-values/m-p/419826#M120710</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/197509"&gt;@prcough&lt;/a&gt; ,&lt;/P&gt;

&lt;P&gt;You're missing the command to allow multiple values:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
transforms.conf&lt;BR /&gt;
[my_sourcetype]&lt;BR /&gt;
DELIMS = "\"{,}", ": "&lt;BR /&gt;
MV_ADD = true&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;You could also try:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[my_sourcetype]&lt;BR /&gt;
REGEX = '([^']+)': '([^']+)'&lt;BR /&gt;
FORMAT = $1::$2&lt;BR /&gt;
MV_ADD = true&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:32:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-list-of-quoted-key-value-pairs-when-some-values/m-p/419826#M120710</guid>
      <dc:creator>jnudell_2</dc:creator>
      <dc:date>2020-09-30T01:32:46Z</dc:date>
    </item>
  </channel>
</rss>

