<?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 convert JSON with multiple values for same metric name in to metric points in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-JSON-with-multiple-values-for-same-metric-name-in/m-p/482629#M193241</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="{ \"samplejson\": [
{
\"epochtime\": 1573532862,
\"value\": 5.29
}, {
\"epochtime\": 1573532562,
\"value\": 5.34
} ] }"
| spath
`comment("this is sample data")`
| eval raw=mvzip('samplejson{}.epochtime','samplejson{}.value')
| table raw
| mvexpand raw
| rex field=raw "(?&amp;lt;_time&amp;gt;[^,]+),(?&amp;lt;CPU_Usage&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, how about this?&lt;/P&gt;</description>
    <pubDate>Sun, 17 Nov 2019 13:09:16 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2019-11-17T13:09:16Z</dc:date>
    <item>
      <title>How to convert JSON with multiple values for same metric name in to metric points</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-JSON-with-multiple-values-for-same-metric-name-in/m-p/482628#M193240</link>
      <description>&lt;P&gt;I have a sample JSON object containing multiple values for same metric_name which is CPU_usage. How to convert it in to multiple metric points whose metric name is same i.e CPU_usage.&lt;/P&gt;

&lt;P&gt;samplejson: [ [-]&lt;BR /&gt;
     { [-]&lt;BR /&gt;
       epochtime: 1573532862&lt;BR /&gt;
       value: 5.29&lt;BR /&gt;
     }&lt;BR /&gt;
     { [-]&lt;BR /&gt;
       epochtime: 1573532562&lt;BR /&gt;
       value: 5.34&lt;BR /&gt;
    }&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:56:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-JSON-with-multiple-values-for-same-metric-name-in/m-p/482628#M193240</guid>
      <dc:creator>ankithreddy777</dc:creator>
      <dc:date>2020-09-30T02:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert JSON with multiple values for same metric name in to metric points</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-JSON-with-multiple-values-for-same-metric-name-in/m-p/482629#M193241</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="{ \"samplejson\": [
{
\"epochtime\": 1573532862,
\"value\": 5.29
}, {
\"epochtime\": 1573532562,
\"value\": 5.34
} ] }"
| spath
`comment("this is sample data")`
| eval raw=mvzip('samplejson{}.epochtime','samplejson{}.value')
| table raw
| mvexpand raw
| rex field=raw "(?&amp;lt;_time&amp;gt;[^,]+),(?&amp;lt;CPU_Usage&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, how about this?&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 13:09:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-JSON-with-multiple-values-for-same-metric-name-in/m-p/482629#M193241</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-17T13:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert JSON with multiple values for same metric name in to metric points</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-JSON-with-multiple-values-for-same-metric-name-in/m-p/482630#M193242</link>
      <description>&lt;P&gt;Hi @to4kawa , I am looking to break events at index time and convert to metric points to store data in metric index&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 14:12:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-JSON-with-multiple-values-for-same-metric-name-in/m-p/482630#M193242</guid>
      <dc:creator>ankithreddy777</dc:creator>
      <dc:date>2019-11-17T14:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert JSON with multiple values for same metric name in to metric points</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-JSON-with-multiple-values-for-same-metric-name-in/m-p/482631#M193243</link>
      <description>&lt;P&gt;OK. I don’t know.  I'm sorry.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 20:20:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-JSON-with-multiple-values-for-same-metric-name-in/m-p/482631#M193243</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-17T20:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert JSON with multiple values for same metric name in to metric points</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-JSON-with-multiple-values-for-same-metric-name-in/m-p/482632#M193244</link>
      <description>&lt;P&gt;This is best done using &lt;CODE&gt;jquery&lt;/CODE&gt; tool before it comes into Splunk.   The king of &lt;CODE&gt;jquery&lt;/CODE&gt; and splunk is @mmodestino_splunk so maybe he will also comment.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 22:12:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-JSON-with-multiple-values-for-same-metric-name-in/m-p/482632#M193244</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-17T22:12:14Z</dc:date>
    </item>
  </channel>
</rss>

