<?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 find get the latest values of a field which is available in different field level in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591226#M11971</link>
    <description>&lt;P&gt;Assuming only one of&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;field1.field2.x.stacktrace{} ,field1.field2.x.x.stacktrace{}, field1.field2.x.x.x.stacktrace{} appears in each event, then&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval stacktrace=coalesce('field1.field2.x.stacktrace{}', 'field1.field2.x.x.stacktrace{}', 'field1.field2.x.x.x.stacktrace{}')
| stats ... latest(stacktrace) as stacktrace ...&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 29 Mar 2022 11:47:29 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-03-29T11:47:29Z</dc:date>
    <item>
      <title>How to find the latest values of a field which is available in different field level?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591217#M11968</link>
      <description>&lt;P&gt;Hi i am new to splunk. i am creating splunk dashboard.i have the interesting fields like field1.field2.x.stacktrace{} ,field1.field2.x.x.stacktrace{}, field1.field2.x.x.x.stacktrace{} ,fieldN.msg , field.time&lt;/P&gt;
&lt;P&gt;i am counting based on fieldN.msg&amp;nbsp; and displaying latest(field.time) ,count(fieldN.msg) for each group using stats( stats count(fieldN.msg) , latest(field.time) by fieldN.msg)&lt;/P&gt;
&lt;P&gt;some events has values in field1.field2.x.stacktrace{}&amp;nbsp; or field1.field2.x.x.stacktrace{} or field1.field2.x.x.x.stacktrace{} . for some events those fields are not even available.&amp;nbsp; for some events it may be available in&amp;nbsp;field1.field2.x.stacktrace{} and&amp;nbsp;field1.field2.x.x.stacktrace{}&amp;nbsp; fields as well&lt;/P&gt;
&lt;P&gt;How can i get the latest stacktrace of each group as another field in stats table if the stacktrace is available in any level or if its not available in any event of the group then "NA" has to be displayed&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 16:40:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591217#M11968</guid>
      <dc:creator>splunker2022</dc:creator>
      <dc:date>2022-04-04T16:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591226#M11971</link>
      <description>&lt;P&gt;Assuming only one of&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;field1.field2.x.stacktrace{} ,field1.field2.x.x.stacktrace{}, field1.field2.x.x.x.stacktrace{} appears in each event, then&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval stacktrace=coalesce('field1.field2.x.stacktrace{}', 'field1.field2.x.x.stacktrace{}', 'field1.field2.x.x.x.stacktrace{}')
| stats ... latest(stacktrace) as stacktrace ...&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Mar 2022 11:47:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591226#M11971</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-29T11:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591241#M11974</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your current search before stats
| eval stacktrace=null()
| foreach *.stacktrace [| eval stacktrace=coalesce('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;', stacktrace) ]
| eval stacktrace=coalesce(stacktrace,"NA")
| stats count(fieldN.msg) , latest(field.time) latest(stacktrace) as stacktrace by fieldN.msg&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Mar 2022 12:35:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591241#M11974</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2022-03-29T12:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591296#M11979</link>
      <description>&lt;P&gt;Thanks for your reply.&amp;nbsp; could you kindly explain what it is doing, so i can understand what it is doing&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 15:56:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591296#M11979</guid>
      <dc:creator>splunker2022</dc:creator>
      <dc:date>2022-03-29T15:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591308#M11980</link>
      <description>&lt;LI-CODE lang="markup"&gt;your current search before stats
| eval stacktrace=null() 
##Created stacktrace field with initial null() value.##
| foreach *.stacktrace [| eval stacktrace=coalesce('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;', stacktrace) ]
## Loop through all *.stacktrace fields that are available at different level,e.g field.x.stacktrace, field.y.z.stacktrace etc, and take the last not-null value and store it in stacktrace field. If you want to take first not-null value, reverse the position of stacktrace. i.e. | eval stacktrace=coalesce(stacktrace, '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')##
| eval stacktrace=coalesce(stacktrace,"NA")
## if stacktrace value is still null after the loop, means no other *.stacktrace field has value, use "NA" as default value.
| stats count(fieldN.msg) , latest(field.time) latest(stacktrace) as stacktrace by fieldN.msg&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Mar 2022 17:07:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591308#M11980</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2022-03-29T17:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591312#M11981</link>
      <description>&lt;P&gt;sorry.what should i add in place of&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 17:37:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591312#M11981</guid>
      <dc:creator>splunker2022</dc:creator>
      <dc:date>2022-03-29T17:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591314#M11982</link>
      <description>&lt;P&gt;That has to be used as is. The '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;' is placeholder literal string for foreach command. Think of it as loop variable or token.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.5/SearchReference/Foreach" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.5/SearchReference/Foreach&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 17:41:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591314#M11982</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2022-03-29T17:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591411#M11991</link>
      <description>&lt;P&gt;Hi. What is &amp;lt;&amp;lt;field&amp;gt;&amp;gt; in the answer. And how to get only first 2 or 3 lines from that stacktrace&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 06:58:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591411#M11991</guid>
      <dc:creator>Paa2428</dc:creator>
      <dc:date>2022-03-30T06:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591419#M11994</link>
      <description>&lt;P&gt;&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; comes from the foreach command (see the documentation as directed earlier)&lt;/P&gt;&lt;P&gt;Not sure what the ask is here - does the stacktrace field already hold the whole trace and you want to trim it to just a couple of lines, or something else?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 07:23:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591419#M11994</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-30T07:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591426#M11995</link>
      <description>&lt;P&gt;Yes. If the returned stacktrace has complete stacktrace and just need to trim 1st 2 or 3 lines..&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 07:47:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591426#M11995</guid>
      <dc:creator>Paa2428</dc:creator>
      <dc:date>2022-03-30T07:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591431#M11996</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex field=stacktrace (?&amp;lt;stacktrace&amp;gt;.+\n.+)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 30 Mar 2022 07:59:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591431#M11996</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-30T07:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591468#M11998</link>
      <description>&lt;P&gt;Hi, in my case the stacktrace is a array containing multiple lines containing the stacktraced..&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;{&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;a:&amp;nbsp;{&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;app:&amp;nbsp;xxx&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Log:&amp;nbsp;{&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;level:&amp;nbsp;fatal&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;msge:&amp;nbsp;err msg&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Y:&amp;nbsp;{&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Zz:&amp;nbsp;{&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Zz:&amp;nbsp;{&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;stackTrace:&amp;nbsp;[&amp;nbsp;&lt;SPAN class=""&gt;ggggggggggggg&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;jijii&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;kjjoijo&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;kjkjlkjlj&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;stackTrace:&amp;nbsp;[&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;line1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;line2&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;line3&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;line4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P class=""&gt;}&lt;/P&gt;&lt;P class=""&gt;stacktrace may/maynot be available in events. if available it is available in different level and i need to get the 1st 2 or 3 lines and display the latest stacktrace and the latest timestamp of event which is grouped based on app&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 11:03:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591468#M11998</guid>
      <dc:creator>splunker2022</dc:creator>
      <dc:date>2022-03-30T11:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591471#M11999</link>
      <description>&lt;P&gt;If stackTrace is a multivalue field, use mvindex&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval shortstack=mvindex(stackTrace,0,1)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 30 Mar 2022 11:04:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591471#M11999</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-30T11:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591485#M12000</link>
      <description>&lt;P&gt;Thanks for helping me .&lt;/P&gt;&lt;P&gt;I am getting NA for all events.. but if i use&amp;nbsp;coalesce('field1.field2.x.stacktrace{} ', 'field1.field2.x.x.stacktrace{}', 'field1.field2.x.x.x.stacktrace{}') i am getting the stacktrace .. but i thought it would be great if i loop through and find the stacktrace at different levels because stacktrace might be in some other level as well&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 11:47:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/591485#M12000</guid>
      <dc:creator>splunker2022</dc:creator>
      <dc:date>2022-03-30T11:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to find get the latest values of a field which is available in different field level</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/592167#M12078</link>
      <description>&lt;P&gt;Hi .. thanks for the reply. i dont know where i am missing. its not working for me.&lt;/P&gt;&lt;P&gt;for instance...&lt;/P&gt;&lt;P&gt;| foreach *.stackTrace [| eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = "hello"]&lt;BR /&gt;| stats latest(field1.field2.x.x.stackTrace) as stacktrace by fieldN.msg&lt;/P&gt;&lt;P&gt;hello is not getting printed&lt;/P&gt;&lt;P&gt;.........&lt;/P&gt;&lt;P&gt;but when i give&amp;nbsp;&lt;/P&gt;&lt;P&gt;| foreach field1.field2.x.x.stackTrace [| eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = "hello"]&lt;BR /&gt;| stats latest(field1.field2.x.x.stackTrace) as stacktrace by fieldN.msg&lt;/P&gt;&lt;P&gt;hello is getting displayed&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 09:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-find-the-latest-values-of-a-field-which-is-available-in/m-p/592167#M12078</guid>
      <dc:creator>manimuthu</dc:creator>
      <dc:date>2022-04-04T09:47:31Z</dc:date>
    </item>
  </channel>
</rss>

