<?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 to create a table showing the sum of values across dictionaries in multiple queries? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-showing-the-sum-of-values-across/m-p/642952#M222694</link>
    <description>&lt;P&gt;If I have queries with dictionaries containing events as the key and frequencies as the value:&lt;/P&gt;&lt;P&gt;line.Data = {"eventOne": 4, "eventThree" : 2};&amp;nbsp; line.Data = {"eventOne": 2, "eventTwo" : 3}&lt;/P&gt;&lt;P&gt;How can I create a table that shows the sum of the different events:&lt;/P&gt;&lt;P&gt;eventOne: 6&lt;/P&gt;&lt;P&gt;eventTwo: 3&lt;/P&gt;&lt;P&gt;eventThree: 2&lt;/P&gt;</description>
    <pubDate>Thu, 11 May 2023 05:03:49 GMT</pubDate>
    <dc:creator>beaverjustin1</dc:creator>
    <dc:date>2023-05-11T05:03:49Z</dc:date>
    <item>
      <title>How to create a table showing the sum of values across dictionaries in multiple queries?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-showing-the-sum-of-values-across/m-p/642952#M222694</link>
      <description>&lt;P&gt;If I have queries with dictionaries containing events as the key and frequencies as the value:&lt;/P&gt;&lt;P&gt;line.Data = {"eventOne": 4, "eventThree" : 2};&amp;nbsp; line.Data = {"eventOne": 2, "eventTwo" : 3}&lt;/P&gt;&lt;P&gt;How can I create a table that shows the sum of the different events:&lt;/P&gt;&lt;P&gt;eventOne: 6&lt;/P&gt;&lt;P&gt;eventTwo: 3&lt;/P&gt;&lt;P&gt;eventThree: 2&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 05:03:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-showing-the-sum-of-values-across/m-p/642952#M222694</guid>
      <dc:creator>beaverjustin1</dc:creator>
      <dc:date>2023-05-11T05:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table showing the sum of values across dictionaries in multiple queries?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-showing-the-sum-of-values-across/m-p/642954#M222696</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your base search&amp;gt;
| stats sum(*) as * by _time
| transpose&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Replace &amp;lt;your base search&amp;gt; with the search that produces the line.Data field containing the dictionaries.&lt;/LI&gt;&lt;LI&gt;Use the stats command with the sum(*) function to calculate the sum of all values in each event category for each _time value. This will create a table with columns _time, eventOne, eventTwo, and eventThree.&lt;/LI&gt;&lt;LI&gt;Use the transpose command to switch the rows and columns of the table so that the event categories become rows and the _time values become columns.&lt;BR /&gt;&lt;BR /&gt;Let me know if it works.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 11 May 2023 05:32:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-showing-the-sum-of-values-across/m-p/642954#M222696</guid>
      <dc:creator>TrangCIC81</dc:creator>
      <dc:date>2023-05-11T05:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table showing the sum of values across dictionaries in multiple queries?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-showing-the-sum-of-values-across/m-p/642958#M222699</link>
      <description>&lt;P&gt;Here is a runanywhere example showing how you could approach this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval line.Data = split("{\"eventOne\": 4, \"eventThree\" : 2};{\"eventOne\": 2, \"eventTwo\" : 3}",";")
| mvexpand line.Data
``` the lines above create sample events, one event per line.Data ```
| spath input=line.Data
| untable line.Data event count
| stats sum(count) as count by event&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 11 May 2023 05:58:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-showing-the-sum-of-values-across/m-p/642958#M222699</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-11T05:58:06Z</dc:date>
    </item>
  </channel>
</rss>

