<?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: How to create a table from nested JSON keys with different names? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375501#M110343</link>
    <description>&lt;P&gt;Yes, you are right, I am trying to make this table.&lt;/P&gt;</description>
    <pubDate>Sun, 18 Feb 2018 11:30:00 GMT</pubDate>
    <dc:creator>DenysB</dc:creator>
    <dc:date>2018-02-18T11:30:00Z</dc:date>
    <item>
      <title>How to create a table from nested JSON keys with different names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375495#M110337</link>
      <description>&lt;P&gt;Part of my json event looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1. "certificatecache":[
2. {"type":"cacheSize","int32value":"10"},
3. {"type":"cacheInUse","int32value":"0"},
4. {"type":"certInCache","int32value":"1"},
5. {"type":"hit","int64gap":"1428335"},
6. {"type":"miss","int64gap":"79397"},
7. {"type":"health","int32value":"100"}
8. ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get fields &lt;CODE&gt;certificatecache{}.type, certificatecache{}.int32value, certificatecache{}.int64gap&lt;/CODE&gt; and try to use spath, but if you notice, both of fields &lt;CODE&gt;certificatecache{}.int32value and certificatecache{}.int64gap&lt;/CODE&gt; contain certificatecache values and it is a problem&lt;/P&gt;

&lt;P&gt;I'd like to create a Table with &lt;CODE&gt;certificatecache_type certificatecache_value&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 17:32:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375495#M110337</guid>
      <dc:creator>DenysB</dc:creator>
      <dc:date>2018-02-14T17:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table from nested JSON keys with different names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375496#M110338</link>
      <description>&lt;P&gt;You can try to use the rename to your advantage: &lt;CODE&gt;| rename certificatecache{}.type as certificatecache_type, certificatecache{}.int* as certificatecache_value&lt;/CODE&gt;. Renaming can help manipulating JSON arrays easier.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 18:25:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375496#M110338</guid>
      <dc:creator>mdsnmss</dc:creator>
      <dc:date>2018-02-14T18:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table from nested JSON keys with different names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375497#M110339</link>
      <description>&lt;P&gt;I got an error:&lt;BR /&gt;
Error in 'rename' command: Wildcard mismatch: 'certificatecache{}.int*' as 'certificatecache_value'. &lt;/P&gt;

&lt;P&gt;In this case, as I understand, I should use:&lt;BR /&gt;
| rename certificatecache{}.type as certificatecache_type, certificatecache{}.int* as certificatecache_value*&lt;BR /&gt;
but it doesn't make sense.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:04:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375497#M110339</guid>
      <dc:creator>DenysB</dc:creator>
      <dc:date>2020-09-29T18:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table from nested JSON keys with different names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375498#M110340</link>
      <description>&lt;P&gt;It looks like you have to rename the JSON array first. Try: &lt;CODE&gt;| rename certificatecache{}.* as * | rename type as certificate_type int* as certificate_value&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 13:03:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375498#M110340</guid>
      <dc:creator>mdsnmss</dc:creator>
      <dc:date>2018-02-15T13:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table from nested JSON keys with different names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375499#M110341</link>
      <description>&lt;P&gt;The same:&lt;BR /&gt;
Error in 'rename' command: Wildcard mismatch: 'int*' as 'certificate_value'. &lt;/P&gt;

&lt;P&gt;I guess it's a wrong way to use rename.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/Rename"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/Rename&lt;/A&gt;&lt;BR /&gt;
"You cannot use the rename command to merge multiple fields into one field because of null, or non-present, fields are brought along with the values."&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 09:05:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375499#M110341</guid>
      <dc:creator>DenysB</dc:creator>
      <dc:date>2018-02-16T09:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table from nested JSON keys with different names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375500#M110342</link>
      <description>&lt;P&gt;Oh, I see now. Yeah, it is trying to combine two fields into one with that. A couple of questions: Are there multiple events like this? You are trying to make a table with multiple rows for the single event, correct? Like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;certificatecache_type                certificatecache_value
cacheSize                                    10
cacheInUse                                 0
certInCache                                1
hit                                             1428335
miss                                          79397
health                                       100
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Feb 2018 12:19:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375500#M110342</guid>
      <dc:creator>mdsnmss</dc:creator>
      <dc:date>2018-02-16T12:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table from nested JSON keys with different names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375501#M110343</link>
      <description>&lt;P&gt;Yes, you are right, I am trying to make this table.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 11:30:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375501#M110343</guid>
      <dc:creator>DenysB</dc:creator>
      <dc:date>2018-02-18T11:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table from nested JSON keys with different names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375502#M110344</link>
      <description>&lt;P&gt;Hi @DenysB,&lt;BR /&gt;
 try coalesce function after getting 3 columns:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eval certificatecache_value=coalesce('certificatecache{}.int32value','certificatecache{}.int64gap')
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Feb 2018 17:09:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375502#M110344</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-18T17:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table from nested JSON keys with different names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375503#M110345</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;
In this case, coalesce doesn't work, because it returns the first value that is not NULL and I get only or int32value or int64gap values.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 07:51:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375503#M110345</guid>
      <dc:creator>DenysB</dc:creator>
      <dc:date>2018-02-21T07:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table from nested JSON keys with different names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375504#M110346</link>
      <description>&lt;P&gt;In each event either  int32value or int64gap values will be present but  not both in a single event...isn't it?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 07:56:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375504#M110346</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-21T07:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table from nested JSON keys with different names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375505#M110347</link>
      <description>&lt;P&gt;No, it is a key problem. I have both int32value and int64gap in a single event.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 09:11:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-from-nested-JSON-keys-with-different-names/m-p/375505#M110347</guid>
      <dc:creator>DenysB</dc:creator>
      <dc:date>2018-02-22T09:11:44Z</dc:date>
    </item>
  </channel>
</rss>

