<?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: Lift fields in nested json object to top level in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Lift-fields-in-nested-json-object-to-top-level/m-p/321323#M59927</link>
    <description>&lt;P&gt;Hi somesoni2, thanks for your answer!&lt;/P&gt;

&lt;P&gt;I didn't knew about that I could it like that "rename stuff.* AS *". This definitely helps.&lt;/P&gt;

&lt;P&gt;I would like to port this to my props.conf, but it doesn't work yet.&lt;/P&gt;

&lt;P&gt;I tried&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;my_sourcetype&amp;gt;]
KV_MODE=json
FIELDALIAS-payload_general = payload.* AS *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but it has no effect whatsoever.&lt;BR /&gt;
Is FIELDALIAS supposed to work with wildcards as well?&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2017 08:18:31 GMT</pubDate>
    <dc:creator>dwh_splunk</dc:creator>
    <dc:date>2017-04-10T08:18:31Z</dc:date>
    <item>
      <title>Lift fields in nested json object to top level</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lift-fields-in-nested-json-object-to-top-level/m-p/321321#M59925</link>
      <description>&lt;P&gt;I have json data like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
  "default": 3
  "payload": { "a": 1,  "b": 4 }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The keys in my payload object differ for different usecases and I want to lift all the key-value pairs in the payload property to top level.&lt;BR /&gt;
I.e I don't want to query 'payload.a' but simply 'a'.&lt;BR /&gt;
With a fixed set of keys I could do this transformation in props.conf but as I said the keys of the payload object vary.&lt;/P&gt;

&lt;P&gt;Is it possible to lift the contents of a nested object?&lt;BR /&gt;
"spath output=$MAGIC path=payload.$MAGIC"&lt;/P&gt;

&lt;P&gt;The best of what I can think at the moment is a (python) custom command, which does the trick, but you know ...&lt;BR /&gt;
Sure there is a better way?!&lt;/P&gt;

&lt;P&gt;PS: We are on splunk 6.4&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 14:01:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lift-fields-in-nested-json-object-to-top-level/m-p/321321#M59925</guid>
      <dc:creator>dwh_splunk</dc:creator>
      <dc:date>2017-04-07T14:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Lift fields in nested json object to top level</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lift-fields-in-nested-json-object-to-top-level/m-p/321322#M59926</link>
      <description>&lt;P&gt;YOu could just simply rename the fields to remove &lt;CODE&gt;payload.&lt;/CODE&gt; portion (using rename command in search OR creating field alias in props.conf/settings-&amp;gt;Fields).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rename payload.* as *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.2/Knowledge/Configurefieldaliaseswithprops.conf"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.2/Knowledge/Configurefieldaliaseswithprops.conf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 14:33:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lift-fields-in-nested-json-object-to-top-level/m-p/321322#M59926</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-07T14:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Lift fields in nested json object to top level</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lift-fields-in-nested-json-object-to-top-level/m-p/321323#M59927</link>
      <description>&lt;P&gt;Hi somesoni2, thanks for your answer!&lt;/P&gt;

&lt;P&gt;I didn't knew about that I could it like that "rename stuff.* AS *". This definitely helps.&lt;/P&gt;

&lt;P&gt;I would like to port this to my props.conf, but it doesn't work yet.&lt;/P&gt;

&lt;P&gt;I tried&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;my_sourcetype&amp;gt;]
KV_MODE=json
FIELDALIAS-payload_general = payload.* AS *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but it has no effect whatsoever.&lt;BR /&gt;
Is FIELDALIAS supposed to work with wildcards as well?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 08:18:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lift-fields-in-nested-json-object-to-top-level/m-p/321323#M59927</guid>
      <dc:creator>dwh_splunk</dc:creator>
      <dc:date>2017-04-10T08:18:31Z</dc:date>
    </item>
  </channel>
</rss>

