<?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 how can i set a variables to each jsonarray object? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-set-a-variables-to-each-jsonarray-object/m-p/665629#M228367</link>
    <description>&lt;P&gt;_Raw json format is below&lt;BR /&gt;{&lt;BR /&gt;"test-03": {&lt;BR /&gt;"field1": 97869,&lt;BR /&gt;"field2": 179771,&lt;BR /&gt;"field3": "test-03",&lt;BR /&gt;"traffics": 1070140210&lt;BR /&gt;},&lt;BR /&gt;"test-08": {&lt;BR /&gt;"field1": 53094,&lt;BR /&gt;"field2": 103840,&lt;BR /&gt;"field3": "test-08",&lt;BR /&gt;"traffics": 998807234&lt;BR /&gt;},&lt;BR /&gt;"test-09": {&lt;BR /&gt;"field1": 145655,&lt;BR /&gt;"field2": 250518,&lt;BR /&gt;"field3": "test-09",&lt;BR /&gt;"traffics": 2212423288&lt;BR /&gt;},&lt;BR /&gt;"test-10": {&lt;BR /&gt;"field1": 83663,&lt;BR /&gt;"field2": 151029,&lt;BR /&gt;"field3": "test-10",&lt;BR /&gt;"traffics": 762554139&lt;BR /&gt;},&lt;BR /&gt;"k": 63314&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;when i use&lt;U&gt;&amp;nbsp; timechart avg(test*.traffics)&lt;/U&gt; , it works&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;but number was so huge, so i tried to change |eval test*.traffics=round(test*.traffics/1024,2) but it didnt work.&lt;/P&gt;&lt;P&gt;can anybody help it please&lt;/P&gt;</description>
    <pubDate>Fri, 20 Oct 2023 00:34:05 GMT</pubDate>
    <dc:creator>ktaeil</dc:creator>
    <dc:date>2023-10-20T00:34:05Z</dc:date>
    <item>
      <title>how can i set a variables to each jsonarray object?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-set-a-variables-to-each-jsonarray-object/m-p/665629#M228367</link>
      <description>&lt;P&gt;_Raw json format is below&lt;BR /&gt;{&lt;BR /&gt;"test-03": {&lt;BR /&gt;"field1": 97869,&lt;BR /&gt;"field2": 179771,&lt;BR /&gt;"field3": "test-03",&lt;BR /&gt;"traffics": 1070140210&lt;BR /&gt;},&lt;BR /&gt;"test-08": {&lt;BR /&gt;"field1": 53094,&lt;BR /&gt;"field2": 103840,&lt;BR /&gt;"field3": "test-08",&lt;BR /&gt;"traffics": 998807234&lt;BR /&gt;},&lt;BR /&gt;"test-09": {&lt;BR /&gt;"field1": 145655,&lt;BR /&gt;"field2": 250518,&lt;BR /&gt;"field3": "test-09",&lt;BR /&gt;"traffics": 2212423288&lt;BR /&gt;},&lt;BR /&gt;"test-10": {&lt;BR /&gt;"field1": 83663,&lt;BR /&gt;"field2": 151029,&lt;BR /&gt;"field3": "test-10",&lt;BR /&gt;"traffics": 762554139&lt;BR /&gt;},&lt;BR /&gt;"k": 63314&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;when i use&lt;U&gt;&amp;nbsp; timechart avg(test*.traffics)&lt;/U&gt; , it works&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;but number was so huge, so i tried to change |eval test*.traffics=round(test*.traffics/1024,2) but it didnt work.&lt;/P&gt;&lt;P&gt;can anybody help it please&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 00:34:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-i-set-a-variables-to-each-jsonarray-object/m-p/665629#M228367</guid>
      <dc:creator>ktaeil</dc:creator>
      <dc:date>2023-10-20T00:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: how can i set a variables to each jsonarray object?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-can-i-set-a-variables-to-each-jsonarray-object/m-p/665640#M228374</link>
      <description>&lt;P&gt;You cannot use wildcard group in eval. &amp;nbsp;Use &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Foreach" target="_blank" rel="noopener"&gt;foreach&lt;/A&gt; to iterate.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach test-*.traffics
    [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = round('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;' / 1024, 2)]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 20 Oct 2023 07:30:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-can-i-set-a-variables-to-each-jsonarray-object/m-p/665640#M228374</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-10-20T07:30:17Z</dc:date>
    </item>
  </channel>
</rss>

