<?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: Cannot use Fields Extracted from JSON by spath in eval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-do-fields-extracted-from-JSON-by-spath-in-eval-result-in/m-p/584160#M203424</link>
    <description>&lt;P&gt;Of course, I've found the answer already.&amp;nbsp; The trick is to use rename.&lt;/P&gt;&lt;P&gt;| rename operations.kv.Get.total_count as totalCount, operations.kv.Get.percentiles_us.100 as getPercentile100us | eval getPercentile100ms=(getPercentile100us/1000)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Feb 2022 18:46:50 GMT</pubDate>
    <dc:creator>stricq</dc:creator>
    <dc:date>2022-02-08T18:46:50Z</dc:date>
    <item>
      <title>Why do fields extracted from JSON by spath in eval result in null?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-do-fields-extracted-from-JSON-by-spath-in-eval-result-in/m-p/584152#M203422</link>
      <description>&lt;P&gt;I cannot use any of the fields extracted by spath inside an eval.&amp;nbsp; The result is always null.&lt;/P&gt;
&lt;P&gt;Input: (formatted for easy reading)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
  "meta": {
    "emit_interval_s": 600
  },
  "operations": {
    "kv": {
      "Get": {
        "total_count": 4,
        "percentiles_us": {
          "75": 17747.0,
          "95": 18706.0,
          "98": 18706.0,
          "99": 18706.0,
          "100": 18706.0
        }
      },
      "GetClusterConfig": {
        "total_count": 708,
        "percentiles_us": {
          "75": 13723.0,
          "95": 14339.550000000001,
          "98": 14567.56,
          "99": 18207.0,
          "100": 18207.0
        }
      },
      "GetMeta": {
        "total_count": 4,
        "percentiles_us": {
          "75": 15776.75,
          "95": 16761.0,
          "98": 16761.0,
          "99": 16761.0,
          "100": 16761.0
        }
      }
    }
  }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this is query:&lt;/P&gt;
&lt;P&gt;| spath input=json_field | eval a=operations.kv.Get.percentiles_us.100 | table json_field operations.kv.Get.percentiles_us.100 a&lt;/P&gt;
&lt;P&gt;In the output, a is always null but the operations.kv.Get.percentiles_us.100 always displays the correct value.&lt;/P&gt;
&lt;P&gt;What's happening here?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 03:32:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-do-fields-extracted-from-JSON-by-spath-in-eval-result-in/m-p/584152#M203422</guid>
      <dc:creator>stricq</dc:creator>
      <dc:date>2022-02-10T03:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot use Fields Extracted from JSON by spath in eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-do-fields-extracted-from-JSON-by-spath-in-eval-result-in/m-p/584160#M203424</link>
      <description>&lt;P&gt;Of course, I've found the answer already.&amp;nbsp; The trick is to use rename.&lt;/P&gt;&lt;P&gt;| rename operations.kv.Get.total_count as totalCount, operations.kv.Get.percentiles_us.100 as getPercentile100us | eval getPercentile100ms=(getPercentile100us/1000)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 18:46:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-do-fields-extracted-from-JSON-by-spath-in-eval-result-in/m-p/584160#M203424</guid>
      <dc:creator>stricq</dc:creator>
      <dc:date>2022-02-08T18:46:50Z</dc:date>
    </item>
  </channel>
</rss>

