<?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 can I get field extractions from a dictionary in a log? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-field-extractions-from-a-dictionary-in-a-log/m-p/430115#M172497</link>
    <description>&lt;P&gt;All, &lt;/P&gt;

&lt;P&gt;I've done this before but I am rusty. My log looks like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1/2/2019 12:34pm priority=info soemthing=12  mydictionary={"iq":"123", "lovescars":"True"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where mydictionary can as many as 30 elements in it. How do I get those into fields? &lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2019 22:45:11 GMT</pubDate>
    <dc:creator>daniel333</dc:creator>
    <dc:date>2019-03-12T22:45:11Z</dc:date>
    <item>
      <title>How can I get field extractions from a dictionary in a log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-field-extractions-from-a-dictionary-in-a-log/m-p/430115#M172497</link>
      <description>&lt;P&gt;All, &lt;/P&gt;

&lt;P&gt;I've done this before but I am rusty. My log looks like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1/2/2019 12:34pm priority=info soemthing=12  mydictionary={"iq":"123", "lovescars":"True"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where mydictionary can as many as 30 elements in it. How do I get those into fields? &lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 22:45:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-field-extractions-from-a-dictionary-in-a-log/m-p/430115#M172497</guid>
      <dc:creator>daniel333</dc:creator>
      <dc:date>2019-03-12T22:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get field extractions from a dictionary in a log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-field-extractions-from-a-dictionary-in-a-log/m-p/430116#M172498</link>
      <description>&lt;P&gt;Hi daniel333,&lt;/P&gt;

&lt;P&gt;try something like this in your &lt;CODE&gt;transforms.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [GetFieldAndValueFromDict]
 SOURCE_KEY = mydictionary
 REGEX  = "([^"]+)":"([^"]+)"
 FORMAT = $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and this in your &lt;CODE&gt;props.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [mySourceType]
 REPORT-000-GetFieldAndValueFromDict = GetFieldAndValueFromDict
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create a field name from capturing group one and the value from capturing group two from within the dict.&lt;BR /&gt;
Put that on your search head and it will work at search time.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 00:13:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-field-extractions-from-a-dictionary-in-a-log/m-p/430116#M172498</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-03-13T00:13:34Z</dc:date>
    </item>
  </channel>
</rss>

