<?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 to show all values of a field on the same table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616459#M214249</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247443"&gt;@din98&lt;/a&gt;&amp;nbsp;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;mentioned, posting search sample and data sample in text would greatly help other people to help you. &amp;nbsp;I want to address a more fundamental issue that you need to consider:&lt;/P&gt;&lt;P&gt;Given that Splunk notation jobs{} indicates an array, which could contain multiple elements, e.g.,&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;_raw&lt;/TD&gt;&lt;TD&gt;_time&lt;/TD&gt;&lt;TD&gt;job.key&lt;/TD&gt;&lt;TD&gt;job.type&lt;/TD&gt;&lt;TD&gt;jobs{}.key&lt;/TD&gt;&lt;TD&gt;jobs{}.type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;{ "job": {"key": "job1", "type": "job.created"}}&lt;/TD&gt;&lt;TD&gt;2022-10-09 13:06:05&lt;/TD&gt;&lt;TD&gt;job1&lt;/TD&gt;&lt;TD&gt;job.created&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;{ "job": {"key": "job3", "type": "job.stopped"}}&lt;/TD&gt;&lt;TD&gt;2022-10-09 13:06:50&lt;/TD&gt;&lt;TD&gt;job3&lt;/TD&gt;&lt;TD&gt;job.stopped&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;{"jobs": [{"key": "job1", "type": "job.started"}, {"key": "job2", "type": "job.completed"}]}&lt;/TD&gt;&lt;TD&gt;2022-10-09 13:09:31&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;job1&lt;/DIV&gt;&lt;DIV class=""&gt;job2&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;job.started&lt;/DIV&gt;&lt;DIV class=""&gt;job.completed&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;If your raw data have such combinations, dereferencing jobs{}.key, etc., directly will give Splunk ambiguous multivalue results. &amp;nbsp;You may need to detangle the array first, that is, use&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Mvexpand#mvexpand" target="_blank" rel="noopener"&gt;mvexpand&lt;/A&gt;&amp;nbsp;to split jobs{}.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=$tnkenvironment$ sourcetype=*json source=*webhook* $tknhost$ Type ="job.*" $tknProcessname$ $tknRobot$ $tknStatus$
| spath input=data path=jobs{} ``` extract the array as unitary field ```
| mvexpand jobs{} ``` creates an event for each element in array ```
| spath input=jobs{} ``` extract nodes in array element ```
| foreach jobs{}.* ``` iterate over each node ```
    [eval &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt; = coalesce(&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;, 'job.&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;')]
| fields - jobs.* jobs{}.*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This way, each element in the array will be tabulated separately, and all JSON nodes can be coalesced without explicitly naming each of them. &amp;nbsp;Using the above data as example, you'll get&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;_time&lt;/TD&gt;&lt;TD&gt;key&lt;/TD&gt;&lt;TD&gt;type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-10-09 13:06:05&lt;/TD&gt;&lt;TD&gt;job1&lt;/TD&gt;&lt;TD&gt;job.created&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-10-09 13:06:50&lt;/TD&gt;&lt;TD&gt;job3&lt;/TD&gt;&lt;TD&gt;job.stopped&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-10-09 13:09:31&lt;/TD&gt;&lt;TD&gt;job1&lt;/TD&gt;&lt;TD&gt;job.started&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-10-09 13:09:31&lt;/TD&gt;&lt;TD&gt;job2&lt;/TD&gt;&lt;TD&gt;job.completed&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Whether you use mvexpand depends on your presentation style, of course. &amp;nbsp;But if you want to further perform statistics on the output, or to use drilldown on any of job attributes, mvexpand will be necessary.&lt;/P&gt;</description>
    <pubDate>Sun, 09 Oct 2022 20:38:29 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2022-10-09T20:38:29Z</dc:date>
    <item>
      <title>How to show all values of a field on the same table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616426#M214235</link>
      <description />
      <pubDate>Sun, 12 Mar 2023 13:01:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616426#M214235</guid>
      <dc:creator>din98</dc:creator>
      <dc:date>2023-03-12T13:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to show all values of a field on the same table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616427#M214236</link>
      <description>&lt;P&gt;You can either just list all the fields in the table command and sometimes they will be null (shown as blank) and other times they will have values, or you can use an eval with an if function or coalesce command to place the values in another field depending on the job type.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2022 11:52:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616427#M214236</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-10-08T11:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to show all values of a field on the same table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616431#M214237</link>
      <description>&lt;P&gt;&lt;FONT color="#FFFFFF"&gt;,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Mar 2023 13:03:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616431#M214237</guid>
      <dc:creator>din98</dc:creator>
      <dc:date>2023-03-12T13:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to show all values of a field on the same table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616432#M214238</link>
      <description>&lt;P&gt;use single quotes around field names (double quotes are for strings)&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2022 13:13:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616432#M214238</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-10-08T13:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to show all values of a field on the same table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616434#M214239</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247443"&gt;@din98&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you should explore the use of colesce option in eval command (&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.1/SearchReference/ConditionalFunctions#coalesce.28X.2C....29" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.1/SearchReference/ConditionalFunctions#coalesce.28X.2C....29&lt;/A&gt;&amp;nbsp;or&amp;nbsp;&lt;A href="https://www.splunk.com/en_us/blog/tips-and-tricks/search-command-coalesce.html?locale=en_us" target="_blank"&gt;https://www.splunk.com/en_us/blog/tips-and-tricks/search-command-coalesce.html?locale=en_us&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=$tnkenvironment$ sourcetype=*json source=*webhook* $tknhost$ Type ="job.*" $tknProcessname$ $tknRobot$ $tknStatus$
| eval 
   'job.created'=coalesce('job.created','job{}.created'),
   'job.stopped'=coalesce('job.stopped','job{}.stopped)'
| table _time ...&lt;/LI-CODE&gt;&lt;P&gt;Then in addition, son't use the search command after the main search it's slower than put the additional search parameter in the main search.&lt;/P&gt;&lt;P&gt;Thne don't use the asterisk at the beginning od a string because you have low performances, it's better to have a list&amp;nbsp; using the IN operator.&lt;/P&gt;&lt;P&gt;Then, next time, please, put your search in the message as text not as screenshot, because in this case I have to manually insert it.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2022 13:27:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616434#M214239</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-08T13:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to show all values of a field on the same table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616439#M214241</link>
      <description>&lt;P&gt;&lt;FONT color="#FFFFFF"&gt;&amp;nbsp;,&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Mar 2023 13:02:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616439#M214241</guid>
      <dc:creator>din98</dc:creator>
      <dc:date>2023-03-12T13:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to show all values of a field on the same table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616449#M214247</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247443"&gt;@din98&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;no problem, it's a pleasure to help you, only one thing: next time, open a new case for a new answer, don't attach it to another already answered one because you'll have less answers.&lt;/P&gt;&lt;P&gt;anyway, you have to create the conditions you described using eval, so for example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval 'Job.Release.ProcessKey'=if(Type='job.created' OR Type='job.stopped','Job.Release.ProcessKey','Jobs{}.Release.ProcessKey')&lt;/LI-CODE&gt;&lt;P&gt;you can use if or case to define all your conditions.&lt;/P&gt;&lt;P&gt;One additional thing, avoid to use fields with spaces or special chars (as doc), it's better to rename them before manipulations and calculations&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rename 
   'Job.Release.ProcessKey' AS Job_ProcessKey 
   'Jobs{}.Release.ProcessKey' AS Jobs_ProcessKey 
| eval Job_ProcessKey=if(Type="job.created" OR Type="job.stopped",Job_ProcessKey,Jobs_ProcessKey)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sun, 09 Oct 2022 09:56:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616449#M214247</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-09T09:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to show all values of a field on the same table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616459#M214249</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247443"&gt;@din98&lt;/a&gt;&amp;nbsp;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;mentioned, posting search sample and data sample in text would greatly help other people to help you. &amp;nbsp;I want to address a more fundamental issue that you need to consider:&lt;/P&gt;&lt;P&gt;Given that Splunk notation jobs{} indicates an array, which could contain multiple elements, e.g.,&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;_raw&lt;/TD&gt;&lt;TD&gt;_time&lt;/TD&gt;&lt;TD&gt;job.key&lt;/TD&gt;&lt;TD&gt;job.type&lt;/TD&gt;&lt;TD&gt;jobs{}.key&lt;/TD&gt;&lt;TD&gt;jobs{}.type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;{ "job": {"key": "job1", "type": "job.created"}}&lt;/TD&gt;&lt;TD&gt;2022-10-09 13:06:05&lt;/TD&gt;&lt;TD&gt;job1&lt;/TD&gt;&lt;TD&gt;job.created&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;{ "job": {"key": "job3", "type": "job.stopped"}}&lt;/TD&gt;&lt;TD&gt;2022-10-09 13:06:50&lt;/TD&gt;&lt;TD&gt;job3&lt;/TD&gt;&lt;TD&gt;job.stopped&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;{"jobs": [{"key": "job1", "type": "job.started"}, {"key": "job2", "type": "job.completed"}]}&lt;/TD&gt;&lt;TD&gt;2022-10-09 13:09:31&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;job1&lt;/DIV&gt;&lt;DIV class=""&gt;job2&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;job.started&lt;/DIV&gt;&lt;DIV class=""&gt;job.completed&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;If your raw data have such combinations, dereferencing jobs{}.key, etc., directly will give Splunk ambiguous multivalue results. &amp;nbsp;You may need to detangle the array first, that is, use&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Mvexpand#mvexpand" target="_blank" rel="noopener"&gt;mvexpand&lt;/A&gt;&amp;nbsp;to split jobs{}.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=$tnkenvironment$ sourcetype=*json source=*webhook* $tknhost$ Type ="job.*" $tknProcessname$ $tknRobot$ $tknStatus$
| spath input=data path=jobs{} ``` extract the array as unitary field ```
| mvexpand jobs{} ``` creates an event for each element in array ```
| spath input=jobs{} ``` extract nodes in array element ```
| foreach jobs{}.* ``` iterate over each node ```
    [eval &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt; = coalesce(&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;, 'job.&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;')]
| fields - jobs.* jobs{}.*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This way, each element in the array will be tabulated separately, and all JSON nodes can be coalesced without explicitly naming each of them. &amp;nbsp;Using the above data as example, you'll get&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;_time&lt;/TD&gt;&lt;TD&gt;key&lt;/TD&gt;&lt;TD&gt;type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-10-09 13:06:05&lt;/TD&gt;&lt;TD&gt;job1&lt;/TD&gt;&lt;TD&gt;job.created&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-10-09 13:06:50&lt;/TD&gt;&lt;TD&gt;job3&lt;/TD&gt;&lt;TD&gt;job.stopped&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-10-09 13:09:31&lt;/TD&gt;&lt;TD&gt;job1&lt;/TD&gt;&lt;TD&gt;job.started&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-10-09 13:09:31&lt;/TD&gt;&lt;TD&gt;job2&lt;/TD&gt;&lt;TD&gt;job.completed&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Whether you use mvexpand depends on your presentation style, of course. &amp;nbsp;But if you want to further perform statistics on the output, or to use drilldown on any of job attributes, mvexpand will be necessary.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Oct 2022 20:38:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616459#M214249</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-10-09T20:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to show all values of a field on the same table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616689#M214323</link>
      <description>&lt;P&gt;&lt;FONT color="#FFFFFF"&gt;,&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Mar 2023 13:02:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616689#M214323</guid>
      <dc:creator>din98</dc:creator>
      <dc:date>2023-03-12T13:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to show all values of a field on the same table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616693#M214325</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247443"&gt;@din98&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I don't know all your conditions, It's important for me that you understand the approach, then you can add all the conditions.&lt;/P&gt;&lt;P&gt;If you have an intersting value to add, you can put it with an additional condition.&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>Tue, 11 Oct 2022 14:20:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-all-values-of-a-field-on-the-same-table/m-p/616693#M214325</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-11T14:20:26Z</dc:date>
    </item>
  </channel>
</rss>

