<?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: Converting json map into table in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/565453#M10051</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237962"&gt;@queryaslan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
|rex field=_raw "\"(?&amp;lt;Users&amp;gt;[^\"]+)\"\s*\:\s*(?&amp;lt;Count&amp;gt;\d+)" max_match=0
| eval t=mvzip(Users,Count) |stats count by t | eval Users=mvindex(split(t,","),0),Count=mvindex(split(t,","),1) | search Users="user*" | table Users Count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="{\"userDocuments\": {\"userA\":1836,\"userD\":1197,\"userB\":606,\"userZ\":108062,\"userE\":972,\"userC\":931}}" 
|rex field=_raw "\"(?&amp;lt;Users&amp;gt;[^\"]+)\"\s*\:\s*(?&amp;lt;Count&amp;gt;\d+)" max_match=0
| eval t=mvzip(Users,Count) |stats count by t | eval Users=mvindex(split(t,","),0),Count=mvindex(split(t,","),1) | search Users="user*"  | table Users Count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-09-01 at 3.31.11 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15799i145EB88606CEFB27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-09-01 at 3.31.11 PM.png" alt="Screenshot 2021-09-01 at 3.31.11 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一 &amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Sep 2021 11:47:13 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2021-09-01T11:47:13Z</dc:date>
    <item>
      <title>Converting json map into table</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/565443#M10050</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm trying out the new Splunk dashboard and the goal is to plot users' database document count over time.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;The log contains a JSON map with the top 100 users with most documents.&amp;nbsp; Since user doc-count differs over time the keys will also differ...&lt;BR /&gt;&lt;BR /&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;userDocuments&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"userA&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;:1836&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;userD&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;:1197&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;"userB&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;:606&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"userZ&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;:108062&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;userE&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;:972&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"userC&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;:931&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;BR /&gt;I'm having a hard time creating a simple table like this&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;User&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;Count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN&gt;userA&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN class="t"&gt;1836&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class="t"&gt;D&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN class="t"&gt;1197&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;B&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN class="t"&gt;606&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Z&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN class="t"&gt;108062&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class="t"&gt;E&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN class="t"&gt;972&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;C&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN class="t"&gt;931&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Any input for a query/changing data structure?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 09:18:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/565443#M10050</guid>
      <dc:creator>queryaslan</dc:creator>
      <dc:date>2021-09-01T09:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Converting json map into table</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/565453#M10051</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237962"&gt;@queryaslan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
|rex field=_raw "\"(?&amp;lt;Users&amp;gt;[^\"]+)\"\s*\:\s*(?&amp;lt;Count&amp;gt;\d+)" max_match=0
| eval t=mvzip(Users,Count) |stats count by t | eval Users=mvindex(split(t,","),0),Count=mvindex(split(t,","),1) | search Users="user*" | table Users Count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="{\"userDocuments\": {\"userA\":1836,\"userD\":1197,\"userB\":606,\"userZ\":108062,\"userE\":972,\"userC\":931}}" 
|rex field=_raw "\"(?&amp;lt;Users&amp;gt;[^\"]+)\"\s*\:\s*(?&amp;lt;Count&amp;gt;\d+)" max_match=0
| eval t=mvzip(Users,Count) |stats count by t | eval Users=mvindex(split(t,","),0),Count=mvindex(split(t,","),1) | search Users="user*"  | table Users Count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-09-01 at 3.31.11 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15799i145EB88606CEFB27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-09-01 at 3.31.11 PM.png" alt="Screenshot 2021-09-01 at 3.31.11 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一 &amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 11:47:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/565453#M10051</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-09-01T11:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Converting json map into table</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/565472#M10052</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp; Thank you! The only problem I have is that have another map in the log so it will parse values from the map into the table. But I guess i could solve the by looking for "user" as a prefix in the regex or if you have a smarter solution?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 11:39:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/565472#M10052</guid>
      <dc:creator>queryaslan</dc:creator>
      <dc:date>2021-09-01T11:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Converting json map into table</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/565475#M10053</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237962"&gt;@queryaslan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just add&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search Users="user*" &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please check my updated answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一 &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 11:47:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/565475#M10053</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-09-01T11:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Converting json map into table</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/566020#M10054</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;sorry for bothering you but how would you add a timestamp column for the table?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "\"(?&amp;lt;Users&amp;gt;[^\"]+)\"\s*\:\s*(?&amp;lt;Count&amp;gt;\d+)" max_match=0 | eval t=mvzip(Users,Count) | stats count by t | eval Users=mvindex(split(t,","),0),Count=mvindex(split(t,","),1) | eval time=0 | foreach User [eval time=_time]| table Users Count total _time | sort by -Count&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 06 Sep 2021 14:03:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/566020#M10054</guid>
      <dc:creator>queryaslan</dc:creator>
      <dc:date>2021-09-06T14:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Converting json map into table</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/566056#M10055</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237962"&gt;@queryaslan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|rex field=_raw "\"(?&amp;lt;Users&amp;gt;[^\"]+)\"\s*\:\s*(?&amp;lt;Count&amp;gt;\d+)" max_match=0
| eval t=mvzip(Users,Count) |mvexpand t | eval Users=mvindex(split(t,","),0),Count=mvindex(split(t,","),1) | search Users="user*"  | table _time Users Count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KV&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 04:27:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Converting-json-map-into-table/m-p/566056#M10055</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-09-07T04:27:26Z</dc:date>
    </item>
  </channel>
</rss>

