<?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: Get count of top level keys from JSON? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Get-count-of-top-level-keys-from-JSON/m-p/522080#M88175</link>
    <description>&lt;P&gt;Do you mean "keys" as in, your example, 'level', 'logger_name', 'process', and so on?&lt;/P&gt;&lt;P&gt;If so, some variant of a search like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=fw 
| fieldsummary 
| fields field, count
| search count&amp;gt;0 NOT field IN ("date*", "eventtype", "index", "linecount", "punct", "source", "sourcetype", "splunk_server", "splunk_server_group", "tag*", "timeendpos", "timestartpos")
| stats count&lt;/LI-CODE&gt;&lt;P&gt;might do it.&amp;nbsp; You'll have to remove the "stats count" at the end to double-check that all the Splunk built-in fields are removed in that `NOT field IN ....` part of the search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 18:27:21 GMT</pubDate>
    <dc:creator>Richfez</dc:creator>
    <dc:date>2020-09-29T18:27:21Z</dc:date>
    <item>
      <title>Get count of top level keys from JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Get-count-of-top-level-keys-from-JSON/m-p/521594#M88124</link>
      <description>&lt;P&gt;my Splunk logs looks like below. Total keys could change based on use case. I need to get exact number of keys from below data and then what is the max key count among those. Please guide me here.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
   level: INFO
   logger_name: com.123.logging
   process: NA
   requestId: 1234567
   attribute: email
   criteria: value
   path: aa.bb.cc
   service_name: SERVICE_NAME
   thread_name: h1234567
   timestamp: 2020-09-26T07:33:53.451Z
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 07:45:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Get-count-of-top-level-keys-from-JSON/m-p/521594#M88124</guid>
      <dc:creator>Pramodkuber</dc:creator>
      <dc:date>2020-09-26T07:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get count of top level keys from JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Get-count-of-top-level-keys-from-JSON/m-p/522080#M88175</link>
      <description>&lt;P&gt;Do you mean "keys" as in, your example, 'level', 'logger_name', 'process', and so on?&lt;/P&gt;&lt;P&gt;If so, some variant of a search like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=fw 
| fieldsummary 
| fields field, count
| search count&amp;gt;0 NOT field IN ("date*", "eventtype", "index", "linecount", "punct", "source", "sourcetype", "splunk_server", "splunk_server_group", "tag*", "timeendpos", "timestartpos")
| stats count&lt;/LI-CODE&gt;&lt;P&gt;might do it.&amp;nbsp; You'll have to remove the "stats count" at the end to double-check that all the Splunk built-in fields are removed in that `NOT field IN ....` part of the search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:27:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Get-count-of-top-level-keys-from-JSON/m-p/522080#M88175</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2020-09-29T18:27:21Z</dc:date>
    </item>
  </channel>
</rss>

