<?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: Return Value from specific key within an Object in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-value-from-specific-key-within-an-object/m-p/609189#M211830</link>
    <description>&lt;P&gt;Thank you very much ITWhisperer!&lt;/P&gt;&lt;P&gt;I was able to achieve what I wanted using the following syntax based on you recommendation:&lt;/P&gt;&lt;P&gt;| &lt;FONT color="#3366FF"&gt;eval&lt;/FONT&gt; myVariable=&lt;FONT color="#FF00FF"&gt;spath&lt;/FONT&gt;(fieldName, "Key2")&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2022 14:59:19 GMT</pubDate>
    <dc:creator>bmohammadi</dc:creator>
    <dc:date>2022-08-11T14:59:19Z</dc:date>
    <item>
      <title>How to return value from specific key within an object?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-value-from-specific-key-within-an-object/m-p/609154#M211818</link>
      <description>&lt;P&gt;Dear Community,&lt;/P&gt;
&lt;P&gt;I am new to Splunk so apologies for the newbie question:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Basic Problem&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I have a field which holds an Object and I am having difficulties retrieving a value from a specific key within this object.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Purpose&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I am running a search and I want to retrieve two datetime values from two separate keys within a field, find the difference between these 2 datetime values and finally return a list of events where the difference is less than a particular value.&lt;/P&gt;
&lt;P&gt;I know how to return a table of results based on a simple criteria and can perform datetime manipulations, I just cannot retrieve the actual datetime values needed to make the calculation.&lt;/P&gt;
&lt;P&gt;*I can successfully store the whole object to a variable using the eval command but cannot extract the value from it.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Assumptions&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The thing I am working with is indeed an Object. I.e. a dictionary style list in the following format&lt;/P&gt;
&lt;P&gt;{"key1" : "value" , "key2" : "value" , "key2" : "value"}&lt;/P&gt;
&lt;P&gt;I am attempting to extract the value using the eval command&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Ben&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 15:08:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-value-from-specific-key-within-an-object/m-p/609154#M211818</guid>
      <dc:creator>bmohammadi</dc:creator>
      <dc:date>2022-08-11T15:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Return Value from specific key within an Object</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-value-from-specific-key-within-an-object/m-p/609156#M211820</link>
      <description>&lt;P&gt;Use spath - by default spath works on _raw, but you can specify an input field e.g. the field holding your object.&lt;/P&gt;&lt;P&gt;If this isn't enough to go on, perhaps you can provide a bit more detail as to what you are dealing with, e.g. some sample events and which fields you have already extracted from them.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 12:09:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-value-from-specific-key-within-an-object/m-p/609156#M211820</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-11T12:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Return Value from specific key within an Object</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-value-from-specific-key-within-an-object/m-p/609189#M211830</link>
      <description>&lt;P&gt;Thank you very much ITWhisperer!&lt;/P&gt;&lt;P&gt;I was able to achieve what I wanted using the following syntax based on you recommendation:&lt;/P&gt;&lt;P&gt;| &lt;FONT color="#3366FF"&gt;eval&lt;/FONT&gt; myVariable=&lt;FONT color="#FF00FF"&gt;spath&lt;/FONT&gt;(fieldName, "Key2")&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 14:59:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-value-from-specific-key-within-an-object/m-p/609189#M211830</guid>
      <dc:creator>bmohammadi</dc:creator>
      <dc:date>2022-08-11T14:59:19Z</dc:date>
    </item>
  </channel>
</rss>

