<?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: retrieve result from array and load in table in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667701#M54625</link>
    <description>&lt;P&gt;Your sample events didn't have duplicates in. Please share some representative unformatted events and explain what your expected results would be from those events.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Nov 2023 14:55:47 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-11-07T14:55:47Z</dc:date>
    <item>
      <title>retrieve result from array and load in table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667644#M54615</link>
      <description>&lt;P class=""&gt;Hi Team,&lt;BR /&gt;I have two event , attaching screenshot for reference&lt;BR /&gt;1.how to retrieve the&amp;nbsp;uniqObjectIds and display in table form&lt;BR /&gt;2.how to retrieve the&amp;nbsp;objectIds,version&amp;nbsp;and display their value in different table column form&lt;BR /&gt;&lt;STRONG&gt;first event:&lt;/STRONG&gt;&lt;BR /&gt;msg:&amp;nbsp;unique objectIds&lt;BR /&gt;name:&amp;nbsp;platform-logger&lt;BR /&gt;pid:&amp;nbsp;8&lt;BR /&gt;uniqObjectIds:&amp;nbsp;[&amp;nbsp;&lt;A href="https://nike.splunkcloud.com/en-US/app/nike_product/search?earliest=1698692400.000&amp;amp;latest=1699301821.000&amp;amp;q=search%20index%3Dnp-papi%20%20%20%20%20source%20IN%20(%22%2Faws%2Flambda%2Fpdp-md-api-support-test-reprocess%22)&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=events&amp;amp;display.events.fields=%5B%22host%22%2C%22source%22%2C%22sourcetype%22%2C%22svc_usage%22%2C%22nike_geo%22%2C%22geo.city%22%2C%22geo.country%22%2C%22geo.lat%22%2C%22geo.long%22%2C%22geo.region%22%2C%22error.message%22%2C%22uniq%22%2C%22uniqObjectIds%7B%7D%22%2C%22uniqueRetrievedIds%7B%7D%22%5D&amp;amp;sid=1699332400.12025455_8BEA4B8A-4839-46D8-B0E8-7E31B8ADEC3F#" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;[-]&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;275649&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp; &amp;nbsp; 108976&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;uniqObjectIdsCount:&amp;nbsp;1&lt;BR /&gt;&lt;STRONG&gt;second event:&lt;BR /&gt;&lt;/STRONG&gt;&amp;nbsp;event:&amp;nbsp;{&amp;nbsp;&lt;A href="https://nike.splunkcloud.com/en-US/app/nike_product/search?earliest=-24h%40h&amp;amp;latest=now&amp;amp;q=search%20index%3Dnp-papi%20%20%20%20%20source%20IN%20(%22%2Faws%2Flambda%2Fpdp-md-api-support-test-reprocess%22)&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=events&amp;amp;display.events.fields=%5B%22host%22%2C%22source%22%2C%22sourcetype%22%2C%22svc_usage%22%2C%22nike_geo%22%2C%22geo.city%22%2C%22geo.country%22%2C%22geo.lat%22%2C%22geo.long%22%2C%22geo.region%22%2C%22error.message%22%2C%22uniq%22%2C%22uniqObjectIds%7B%7D%22%2C%22uniqueRetrievedIds%7B%7D%22%5D&amp;amp;sid=1699334120.4025805_F7826693-FD74-4D49-8E85-82E380C47EF5#" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;[-]&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;body:&amp;nbsp;{ "objectType": "material", "objectIds": [ "275649" ], "version": "latest" }&lt;BR /&gt;msg:&amp;nbsp;request body&lt;BR /&gt;&lt;BR /&gt;The query i came closest is below but still unable to get what i wanted.&lt;BR /&gt;Actual :&lt;BR /&gt;Expected: in a table , i get the each object in different row .ex&lt;BR /&gt;|uniqueIds|&lt;BR /&gt;|275649|&lt;BR /&gt;||108976&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="" source IN ("") | eval PST=_time-28800 | eval PST_TIME=strftime(PST, "%Y-%d-%m %H:%M:%S") | eval split_field= split(_raw, "Z\"}") | mvexpand split_field | rex field=split_field "objectIdsCount=(?&amp;lt;objectIdsCount&amp;gt;[^,]+)" | rex field=split_field "uniqObjectIdsCount=(?&amp;lt;uniqObjectIdsCount&amp;gt;[^,]+)" | rex field=split_field "recordsCount=(?&amp;lt;recordsCount&amp;gt;[^,]+)" | rex field=split_field "sqsSentCount=(?&amp;lt;sqsSentCount&amp;gt;[^,]+)"|where objectType="material" | table_time,PST_TIME,objectType,objectIdsCount,uniqObjectIdsCount,recordsCount,sqsSentCount | sort _time desc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 07:20:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667644#M54615</guid>
      <dc:creator>nithys</dc:creator>
      <dc:date>2023-11-07T07:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve result from array and load in table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667678#M54619</link>
      <description>&lt;P&gt;This looks like your events might be in JSON format. Please share your unformatted raw events in a code block &amp;lt;/&amp;gt; to preserve the formatting in your events, so we might be able to assist you.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 12:54:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667678#M54619</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-11-07T12:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve result from array and load in table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667686#M54620</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Team,&lt;BR /&gt;First Event where i need to retrieve the&amp;nbsp;uniqObjectIds&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"name":"","awsRequestId":"","hostname":"","pid":8,"level":30,"uniqObjectIds":["275649"],"uniqObjectIdsCount":1,"msg":"unique objectIds","time":"","v":0}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;below is one event where i want the fields objecttype,objectids,version to retrieve&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	
{"name":"","awsRequestId":"","hostname":"","pid":8,"level":30,"eventBody":{"objectType":"material","objectIds":["275649"],"version":"latest"},"msg":"request body","time":"2023-11-06T22:48:03.330Z","v":0}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Wanted to retrieve above two events data in the below query&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="" source IN ("") | eval PST=_time-28800 | eval PST_TIME=strftime(PST, "%Y-%d-%m %H:%M:%S") | eval split_field= split(_raw, "Z\"}") | mvexpand split_field | rex field=split_field "objectIdsCount=(?&amp;lt;objectIdsCount&amp;gt;[^,]+)" | rex field=split_field "uniqObjectIdsCount=(?&amp;lt;uniqObjectIdsCount&amp;gt;[^,]+)" | rex field=split_field "recordsCount=(?&amp;lt;recordsCount&amp;gt;[^,]+)" | rex field=split_field "sqsSentCount=(?&amp;lt;sqsSentCount&amp;gt;[^,]+)"|where objectType="material" | table_time,PST_TIME,objectType,objectIdsCount,uniqObjectIdsCount,recordsCount,sqsSentCount | sort _time desc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 14:04:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667686#M54620</guid>
      <dc:creator>nithys</dc:creator>
      <dc:date>2023-11-07T14:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve result from array and load in table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667690#M54623</link>
      <description>&lt;P&gt;Since this is JSON, if you haven't already ingested it as JSON, you can extract the fields with the spath command&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| spath
| spath input=eventBody&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 07 Nov 2023 14:16:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667690#M54623</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-11-07T14:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve result from array and load in table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667697#M54624</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;THANKS for the above query which worked to get the data from that json in a table form.but data are displayed as duplicate/doble&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="" source IN ("") "request body"| spath
| spath input=eventBody,eventBody.objectIds{}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-07 at 6.42.29 AM.png" style="width: 872px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27981i4BC7E93821E523D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-11-07 at 6.42.29 AM.png" alt="Screenshot 2023-11-07 at 6.42.29 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 14:44:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667697#M54624</guid>
      <dc:creator>nithys</dc:creator>
      <dc:date>2023-11-07T14:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve result from array and load in table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667701#M54625</link>
      <description>&lt;P&gt;Your sample events didn't have duplicates in. Please share some representative unformatted events and explain what your expected results would be from those events.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 14:55:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667701#M54625</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-11-07T14:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve result from array and load in table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667901#M54644</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;the above spath query which worked and was able to form a table view without duplicate.&lt;BR /&gt;How can i combine two events results in a single row rather than display in two rows ,there is no common key to do stats by it has&amp;nbsp;same source and index only the msg. is different&lt;/SPAN&gt;&lt;BR /&gt;1.Currently&amp;nbsp;uniqObjectIds,uniqueRetrievedIds are displayed in two rows in a table view,wanted as a single row&lt;BR /&gt;2.How to combine multiple event in a single query if there is no common key&lt;BR /&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= ""    source IN ("")  "uniqObjectIds"  OR "data retrieved for Ids"
 | spath output=uniqObjectIds path=uniqObjectIds{}  | spath output=uniqueRetrievedIds path=uniqueRetrievedIds{} |  eval PST=_time-28800 | eval PST_TIME=strftime(PST, "%Y-%d-%m %H:%M:%S") | eval split_field= split(_raw, "Z\"}") | mvexpand split_field | rex field=split_field "objectIdsCount=(?&amp;lt;objectIdsCount&amp;gt;[^,]+)" | rex field=split_field "uniqObjectIdsCount=(?&amp;lt;uniqObjectIdsCount&amp;gt;[^,]+)" | rex field=split_field "recordsCount=(?&amp;lt;recordsCount&amp;gt;[^,]+)" | rex field=split_field "sqsSentCount=(?&amp;lt;sqsSentCount&amp;gt;[^,]+)" | table_time,PST_TIME,objectType,objectIdsCount,uniqObjectIdsCount,recordsCount,sqsSentCount,uniqObjectIds,uniqueRetrievedIds | sort _time desc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-08 at 6.33.28 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27998i63428102C8DF5616/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-11-08 at 6.33.28 AM.png" alt="Screenshot 2023-11-08 at 6.33.28 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 14:44:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667901#M54644</guid>
      <dc:creator>nithys</dc:creator>
      <dc:date>2023-11-08T14:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve result from array and load in table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667909#M54647</link>
      <description>&lt;P&gt;Since these come from the same raw event(?) you could regather the fields with a stats command&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats values(*) as * by _raw&lt;/LI-CODE&gt;&lt;P&gt;You may need to add _raw to your list of fields in the table command or use another field which is unique to the original event, e.g. _time&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 15:12:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/667909#M54647</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-11-08T15:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve result from array and load in table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/668211#M54679</link>
      <description>&lt;P&gt;thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; Above solution worked&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 08:38:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/retrieve-result-from-array-and-load-in-table/m-p/668211#M54679</guid>
      <dc:creator>nithys</dc:creator>
      <dc:date>2023-11-10T08:38:30Z</dc:date>
    </item>
  </channel>
</rss>

