<?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 Searches returning unexpected results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Searches-returning-unexpected-results/m-p/741456#M240620</link>
    <description>&lt;P&gt;I am fairly new to Splunk. I am testing out different search queries and getting &amp;nbsp;inconsistent results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example I have some pretty simple json/logs with the following format&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "data": {
    "tree": {
      "fruit": {
        "type": "Pear"
      }
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying several different searches and seeing some unexpected results.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;"data.tree.fruit.type"="Apple" - Returns Apple only results (as expected)&lt;/LI&gt;&lt;LI&gt;*| spath "data.tree.fruit.type" | search "data.tree.fruit.type"=Apple - Returns Apple only results (as expected)&lt;/LI&gt;&lt;LI&gt;"data.tree.fruit.type"="Pear" - Returns NO results (unexpected?)&lt;/LI&gt;&lt;LI&gt;*| spath "data.tree.fruit.type" | search "data.tree.fruit.type"=Pear - Returns Pear only results (as expected)&lt;/LI&gt;&lt;LI&gt;"data.tree.fruit.type"="*" - Returns Apple only results (unexpected)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Can anyone shed some light on why I'm seeing the varying results?&lt;/P&gt;</description>
    <pubDate>Tue, 11 Mar 2025 19:20:53 GMT</pubDate>
    <dc:creator>tchamp</dc:creator>
    <dc:date>2025-03-11T19:20:53Z</dc:date>
    <item>
      <title>Searches returning unexpected results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searches-returning-unexpected-results/m-p/741456#M240620</link>
      <description>&lt;P&gt;I am fairly new to Splunk. I am testing out different search queries and getting &amp;nbsp;inconsistent results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example I have some pretty simple json/logs with the following format&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "data": {
    "tree": {
      "fruit": {
        "type": "Pear"
      }
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying several different searches and seeing some unexpected results.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;"data.tree.fruit.type"="Apple" - Returns Apple only results (as expected)&lt;/LI&gt;&lt;LI&gt;*| spath "data.tree.fruit.type" | search "data.tree.fruit.type"=Apple - Returns Apple only results (as expected)&lt;/LI&gt;&lt;LI&gt;"data.tree.fruit.type"="Pear" - Returns NO results (unexpected?)&lt;/LI&gt;&lt;LI&gt;*| spath "data.tree.fruit.type" | search "data.tree.fruit.type"=Pear - Returns Pear only results (as expected)&lt;/LI&gt;&lt;LI&gt;"data.tree.fruit.type"="*" - Returns Apple only results (unexpected)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Can anyone shed some light on why I'm seeing the varying results?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 19:20:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searches-returning-unexpected-results/m-p/741456#M240620</guid>
      <dc:creator>tchamp</dc:creator>
      <dc:date>2025-03-11T19:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Searches returning unexpected results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searches-returning-unexpected-results/m-p/741468#M240621</link>
      <description>&lt;P&gt;It's likely that your auto extracted JSON fields are not extracting the entire object, i.e. if you search&amp;nbsp;&lt;STRONG&gt;type=*&lt;/STRONG&gt; and it does not find some values, then those values do not exist in that field in the auto extracted field.&lt;/P&gt;&lt;P&gt;The fact that they&amp;nbsp;&lt;STRONG&gt;DO&lt;/STRONG&gt; give results after the spath, indicates this.&lt;/P&gt;&lt;P&gt;What is the size of your JSON object. By default I believe it will only auto extract the first 5000 (5k?) bytes of a JSON object, so if you show "raw" in your display rather than the syntax highlighted view of the JSON, you can see where your fruit type field exists in the raw.&lt;/P&gt;&lt;P&gt;If this is the case, then you can add some calculated fields using spath eval statement to extract the fields, so they are always present before the search is run.&lt;/P&gt;&lt;P&gt;BTW, I'm not totally sure of the best practice way to manage this 5k limit, but the above will work.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 21:37:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searches-returning-unexpected-results/m-p/741468#M240621</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-03-11T21:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Searches returning unexpected results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searches-returning-unexpected-results/m-p/741475#M240624</link>
      <description>&lt;P&gt;The JSON objects are very large and way over 5KB in size. I will look into calculated fields unless anyone else has a better suggestion.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 22:08:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searches-returning-unexpected-results/m-p/741475#M240624</guid>
      <dc:creator>tchamp</dc:creator>
      <dc:date>2025-03-11T22:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Searches returning unexpected results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searches-returning-unexpected-results/m-p/741481#M240627</link>
      <description>&lt;P&gt;Here are a couple of links to other posts here&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/JSON-field-extraction-beyond-5000-chars/m-p/549963#:~:text=The%20auto%2Dfield%2Dextraction%20stops,result%20list%20after%20a%20search" target="_blank"&gt;https://community.splunk.com/t5/Getting-Data-In/JSON-field-extraction-beyond-5000-chars/m-p/549963#:~:text=The%20auto%2Dfield%2Dextraction%20stops,result%20list%20after%20a%20search&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/Missing-events-JSON-payload-and-indexed-extractions/m-p/489113" target="_blank"&gt;https://community.splunk.com/t5/Getting-Data-In/Missing-events-JSON-payload-and-indexed-extractions/m-p/489113&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you start changing limits.conf - which is not simple with Cloud, it will affect general settings, so is not always the best way to go.&lt;/P&gt;&lt;P&gt;If you have a field that is not extracted and it's a simple field - i.e. a single value inside a JSON object with no multivalue component then a simple calculated field can work, i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval type=spath(_raw, "data.tree.fruit.type")&lt;/LI-CODE&gt;&lt;P&gt;In the conf just use the spath... part for the eval definition&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 22:25:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searches-returning-unexpected-results/m-p/741481#M240627</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-03-11T22:25:35Z</dc:date>
    </item>
  </channel>
</rss>

