<?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 to get JSON fields data into a table? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-JSON-fields-data-into-a-table/m-p/633681#M51942</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I have asked a similar question and i got the answer.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/How-to-format-JSON-data-into-a-table/m-p/615115#M50466" target="_self"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/How-to-format-JSON-data-into-a-table/m-p/615115#M50466&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But my doubt is if the fields in the JSON file are dynamic how can i get those into table.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "Info": {
        "Unit": "ABC",
        "Project": "XYZ",
        "Analysis Summary": {
            "DB1": {
                "Available": "1088kB",
                "Used": "173.23kB",
                "Used(%)": "15.92%",
                "Status": "OK"
            },
            "DB2": {
                "Available": "4096kB",
                "Used": "1591.85kB",
                "Used(%)": "38.86%",
                "Status": "OK"
            },
            "DB3": {
                "Available": "128kB",
                "Used(%)": "2.6%",
                "Status": "OK"
            },
            "DB4": {
                "Available": "16500kB",
                "Used": "6696.0",
                "Used(%)": "40.58%",
                "Status": "OK"
            },
            "DB5": {
                "Available": "22000kB",
                "Used": "9800.0",
                "Used(%)": "44.55%",
                "Status": "OK"
            }
        },
        "RAM_Tracking": {
            "a": "2",
            "b": "1088.0",
            "c": "32.1220703125",
        },
        "Database2_info": {
            "a": "4",
            "b": "4096.0",
            "c": "654.3212890625",
        },
        "Database3_info": {
            "a": "5",
            "b": "6696",
            "c": "9800",
        },
        "Database4_info": {
            "a": "6",
            "b": "128.0",
            "c": "21.086",
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;As you see in the field "Used" is missing in DB3.But i want to show it in table as empty.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Database available  used	used%	status
DB1     4096KB	    1582.07kB	38.62%	OK
DB2	1088kB	    172.8kB	15.88%	OK
DB3     128KB	     NA	         0%	OK
DB4	22000KB	    9800.0KB	44.55%	OK
DB5     16500KB	    6696.0KB	40.58%	OK&lt;/LI-CODE&gt;&lt;P&gt;Wherever there is no data i want to keep it as "NA". Till now i have only used constant data. Is it possible to create a table like this using dynamic data? Can anyone please help me.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Mar 2023 07:38:14 GMT</pubDate>
    <dc:creator>anooshac</dc:creator>
    <dc:date>2023-03-08T07:38:14Z</dc:date>
    <item>
      <title>How to get JSON fields data into a table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-JSON-fields-data-into-a-table/m-p/633681#M51942</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I have asked a similar question and i got the answer.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/How-to-format-JSON-data-into-a-table/m-p/615115#M50466" target="_self"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/How-to-format-JSON-data-into-a-table/m-p/615115#M50466&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But my doubt is if the fields in the JSON file are dynamic how can i get those into table.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "Info": {
        "Unit": "ABC",
        "Project": "XYZ",
        "Analysis Summary": {
            "DB1": {
                "Available": "1088kB",
                "Used": "173.23kB",
                "Used(%)": "15.92%",
                "Status": "OK"
            },
            "DB2": {
                "Available": "4096kB",
                "Used": "1591.85kB",
                "Used(%)": "38.86%",
                "Status": "OK"
            },
            "DB3": {
                "Available": "128kB",
                "Used(%)": "2.6%",
                "Status": "OK"
            },
            "DB4": {
                "Available": "16500kB",
                "Used": "6696.0",
                "Used(%)": "40.58%",
                "Status": "OK"
            },
            "DB5": {
                "Available": "22000kB",
                "Used": "9800.0",
                "Used(%)": "44.55%",
                "Status": "OK"
            }
        },
        "RAM_Tracking": {
            "a": "2",
            "b": "1088.0",
            "c": "32.1220703125",
        },
        "Database2_info": {
            "a": "4",
            "b": "4096.0",
            "c": "654.3212890625",
        },
        "Database3_info": {
            "a": "5",
            "b": "6696",
            "c": "9800",
        },
        "Database4_info": {
            "a": "6",
            "b": "128.0",
            "c": "21.086",
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;As you see in the field "Used" is missing in DB3.But i want to show it in table as empty.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Database available  used	used%	status
DB1     4096KB	    1582.07kB	38.62%	OK
DB2	1088kB	    172.8kB	15.88%	OK
DB3     128KB	     NA	         0%	OK
DB4	22000KB	    9800.0KB	44.55%	OK
DB5     16500KB	    6696.0KB	40.58%	OK&lt;/LI-CODE&gt;&lt;P&gt;Wherever there is no data i want to keep it as "NA". Till now i have only used constant data. Is it possible to create a table like this using dynamic data? Can anyone please help me.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 07:38:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-JSON-fields-data-into-a-table/m-p/633681#M51942</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2023-03-08T07:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get JSON fields data into a table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-JSON-fields-data-into-a-table/m-p/633685#M51943</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/30057"&gt;@anooshac&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;using the "spath" command (&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Spath" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Spath&lt;/A&gt;), you transform your json logs in table format that you can organize as you like.&lt;/P&gt;&lt;P&gt;If you have some empty fields, you can usi the "fillnull" command (&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.4/SearchReference/Fillnull" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.4/SearchReference/Fillnull&lt;/A&gt;) to put the "NA" value instead NULL or empty.&lt;/P&gt;&lt;P&gt;so you could have something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| spath
| rename &amp;lt;json-fields&amp;gt; ...
| fillnull value="NA" available
| fillnull value="NA" used
| fillnull value="NA" used%
| fillnull value="NA" status
| table ...&lt;/LI-CODE&gt;&lt;P&gt;remember to rename the fields from the json format to the table format to have the column fields you want.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 07:56:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-JSON-fields-data-into-a-table/m-p/633685#M51943</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-08T07:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to get JSON fields data into a table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-JSON-fields-data-into-a-table/m-p/633686#M51944</link>
      <description>&lt;P&gt;Assuming the incorrect JSON format is an artefact of copy/paste or spoofed example generation. try the following&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| spath "Info.Analysis Summary" output=AnalysisSummary
| rex field=AnalysisSummary max_match=0 "(?&amp;lt;Database&amp;gt;\"\w+\":\s*\{[^\}]+\})"
| mvexpand Database
| rex field=Database "(?ms)\"(?&amp;lt;Database&amp;gt;[^\"]+)\":\s+(?&amp;lt;Summary&amp;gt;.*)"
| spath input=Summary
| fillnull value="NA"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 Mar 2023 08:06:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-JSON-fields-data-into-a-table/m-p/633686#M51944</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-08T08:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get JSON fields data into a table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-JSON-fields-data-into-a-table/m-p/634012#M51973</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/30057"&gt;@anooshac&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please check the below link for your ask?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/How-to-format-JSON-data-into-a-table/m-p/633736/highlight/true#M51954" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/How-to-format-JSON-data-into-a-table/m-p/633736/highlight/true#M51954&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KV&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 06:53:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-JSON-fields-data-into-a-table/m-p/634012#M51973</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2023-03-10T06:53:04Z</dc:date>
    </item>
  </channel>
</rss>

