<?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 can I deserialize a JSON string to be shown as Event? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-deserialize-a-JSON-string-to-be-shown-as-Event/m-p/553568#M38416</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;! That helped with finding the answer. I can't pass the job id from the table result, because the result is still a table and does not include events. However, I can have both panels share the same job.&lt;/P&gt;&lt;P&gt;I created another panel and hid it. This hidden panel runs the same search as the table panel, but without the last " | table ..." command, so that I can have a result set of events. Then I changed both table and panel event to load that job and search through that.&lt;/P&gt;&lt;P&gt;The table panel uses a query like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| loadjob $job_id$ | table Time, Level, Message,...&lt;/LI-CODE&gt;&lt;P&gt;And events panel uses a query like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| loadjob $job_id$ | search EventId=$selected_event_id$&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that if the hidden panel search does not extract the fields you're going to use when you load the job, you need to add "spath" after "loadjob", e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| loadjob $job_id$ | spath | table Time,...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see this question for how to store job id in a token:&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-search-ID-job-sid-from-XML-dashboard-in-JavaScript/m-p/374089" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-search-ID-job-sid-from-XML-dashboard-in-JavaScript/m-p/374089&lt;/A&gt;&lt;/P&gt;&lt;P&gt;for hiding a panel:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;panel depends="$always_hide$"&amp;gt;
&amp;lt;/panel&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 May 2021 17:56:09 GMT</pubDate>
    <dc:creator>arminbashizade</dc:creator>
    <dc:date>2021-05-28T17:56:09Z</dc:date>
    <item>
      <title>How can I deserialize a JSON string to be shown as Event?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-deserialize-a-JSON-string-to-be-shown-as-Event/m-p/553000#M38329</link>
      <description>&lt;P&gt;I've created a dashboard for searching and filtering events, and it consists of two panels for presenting the results:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;a table to show a summary of the events based on search criteria, columns are: Time, CorrelationId, Service Name, Log Level, and Message, which are shared attributes among all events&lt;/LI&gt;&lt;LI&gt;an Events panel to show the entirety of an event, which includes attributes that are specific to an event and are not shared with other events, e.g. Stack Trace for errors&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;the table's drilldown is set to "row", and when a row is clicked it sets some tokens that are used to search &lt;EM&gt;again&lt;/EM&gt;&amp;nbsp;to find that event and show it on the Events panel.&lt;/P&gt;&lt;P&gt;My goal is to avoid the second search, because the event is already retrieved by the table panel.&lt;/P&gt;&lt;P&gt;I've tried passing _raw from table panel to events panel and use &lt;FONT face="lucida sans unicode,lucida sans"&gt;makeresults&lt;/FONT&gt; but that command creates a table row and can only be viewed under Statistics/Table tab and does not show anything when Events/List tab is selected. What I need is to view the event in the format that is shown in the screenshot below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arminbashizade_0-1621441676858.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14222i6CE70EB863430C0C/image-size/large?v=v2&amp;amp;px=999" role="button" title="arminbashizade_0-1621441676858.png" alt="arminbashizade_0-1621441676858.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I know that renaming a JSON to _raw will deserialize it, but that requires a result-set of events to begin with, e.g.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;* | head 1 | eval tmp="{\"key\":\"value\"}" | rename tmp as _raw&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;will show the new JSON instead of the original event&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arminbashizade_1-1621443045190.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14223i5DA70FE53FE27708/image-size/medium?v=v2&amp;amp;px=400" role="button" title="arminbashizade_1-1621443045190.png" alt="arminbashizade_1-1621443045190.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but the below query with makeresults does not give the same result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval tmp="{\"key\":\"value\"}" | rename tmp as _raw&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arminbashizade_2-1621443109487.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14224iEF5D37AC681493A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="arminbashizade_2-1621443109487.png" alt="arminbashizade_2-1621443109487.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;only Statistics tab shows results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To summarize, I want to get the event in the format that can be seen in the first screenshot above, but without running a search, because I already have the entire event, including its _raw.&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 17:05:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-deserialize-a-JSON-string-to-be-shown-as-Event/m-p/553000#M38329</guid>
      <dc:creator>arminbashizade</dc:creator>
      <dc:date>2021-05-25T17:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I deserialize a JSON string to be shown as Event?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-deserialize-a-JSON-string-to-be-shown-as-Event/m-p/553469#M38398</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234586"&gt;@arminbashizade&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bcoz here we have an event to replace _raw with new values.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;* | head 1 | eval tmp="{\"key\":\"value\"}" | rename tmp as _raw&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;will show the new JSON instead of the original event&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the below query with makeresults does not give the same result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval tmp="{\"key\":\"value\"}" | rename tmp as _raw&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well &amp;nbsp;with this search, you can not see events in event tab bcoz makeresults it will generate results which you can see in statistics tab not event.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But with the makeresults you can have fields. Try this,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="{\"key\":\"value\"}"| extract&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need exact representations of an event then use below search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;* | head 1 | eval _raw="{\"key\":\"value\"}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一&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>Fri, 28 May 2021 09:33:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-deserialize-a-JSON-string-to-be-shown-as-Event/m-p/553469#M38398</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-05-28T09:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can I deserialize a JSON string to be shown as Event?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-deserialize-a-JSON-string-to-be-shown-as-Event/m-p/553472#M38399</link>
      <description>&lt;P&gt;Have you tried saving the the job id in a token and passing that in the drilldown and using loadjob to retrieve the results?&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 09:47:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-deserialize-a-JSON-string-to-be-shown-as-Event/m-p/553472#M38399</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-28T09:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I deserialize a JSON string to be shown as Event?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-deserialize-a-JSON-string-to-be-shown-as-Event/m-p/553568#M38416</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;! That helped with finding the answer. I can't pass the job id from the table result, because the result is still a table and does not include events. However, I can have both panels share the same job.&lt;/P&gt;&lt;P&gt;I created another panel and hid it. This hidden panel runs the same search as the table panel, but without the last " | table ..." command, so that I can have a result set of events. Then I changed both table and panel event to load that job and search through that.&lt;/P&gt;&lt;P&gt;The table panel uses a query like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| loadjob $job_id$ | table Time, Level, Message,...&lt;/LI-CODE&gt;&lt;P&gt;And events panel uses a query like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| loadjob $job_id$ | search EventId=$selected_event_id$&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that if the hidden panel search does not extract the fields you're going to use when you load the job, you need to add "spath" after "loadjob", e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| loadjob $job_id$ | spath | table Time,...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see this question for how to store job id in a token:&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-search-ID-job-sid-from-XML-dashboard-in-JavaScript/m-p/374089" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-search-ID-job-sid-from-XML-dashboard-in-JavaScript/m-p/374089&lt;/A&gt;&lt;/P&gt;&lt;P&gt;for hiding a panel:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;panel depends="$always_hide$"&amp;gt;
&amp;lt;/panel&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 17:56:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-deserialize-a-JSON-string-to-be-shown-as-Event/m-p/553568#M38416</guid>
      <dc:creator>arminbashizade</dc:creator>
      <dc:date>2021-05-28T17:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: How can I deserialize a JSON string to be shown as Event?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-deserialize-a-JSON-string-to-be-shown-as-Event/m-p/553574#M38418</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234586"&gt;@arminbashizade&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;loadjob&amp;nbsp;will work on single search head but on cluster it might now work.&lt;/P&gt;&lt;P&gt;A search head cluster can run the&amp;nbsp;loadjob&amp;nbsp;command only on scheduled saved searches. A search head cluster runs searches on results or artifacts that the search head cluster replicates.&lt;/P&gt;&lt;P&gt;So for safe side &amp;nbsp;just verify your dashboard on cluster as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Loadjob#Search_head_clusters" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Loadjob#Search_head_clusters&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一&lt;/P&gt;&lt;P&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 18:57:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-deserialize-a-JSON-string-to-be-shown-as-Event/m-p/553574#M38418</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-05-28T18:57:23Z</dc:date>
    </item>
  </channel>
</rss>

