<?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: Construct multivariable histogram chart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Construct-multivariable-histogram-chart/m-p/629414#M218644</link>
    <description>&lt;P&gt;You could do trellis view with independent y-axis, but it depends on the number of variants you have as to whether it looks good or not.&lt;/P&gt;&lt;P&gt;Alternatively normalising all data can be done with&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| chart count by duration_seconds host_type limit=0 span=1.0
| addtotals
| eval Total=Total-coalesce(tonumber(duration_seconds),0)
| foreach * [ eval "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"=if("&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;"="duration_seconds" OR "&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;"="Total", '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;', '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'/Total*100) ]
| fields - Total&lt;/LI-CODE&gt;&lt;P&gt;it's a bit messy with doing just addtotals for all fields, as that adds all totals and presumably your duration_seconds is numeric, so it will get included in the total counts. If you know host_type values, you can use those instead to avoid the "if" in the foreach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Feb 2023 00:55:05 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-02-03T00:55:05Z</dc:date>
    <item>
      <title>Construct multivariable histogram chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Construct-multivariable-histogram-chart/m-p/629412#M218643</link>
      <description>&lt;P&gt;I have a search along these lines&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;"duration: "
| rex field=host "(?P&amp;lt;host_type&amp;gt;[my_magic_regex])"
| rex "duration: (?P&amp;lt;duration_seconds&amp;gt;[0-9]+)"
| chart count by duration_seconds host_type limit=0 span=1.0&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is working exactly as expected. However, since I am doing &lt;EM&gt;count&lt;/EM&gt;&amp;nbsp;by ... for each host type, the histograms constructed for each host_type vary wildly.&amp;nbsp;&lt;BR /&gt;The lines have such a different scale that overlaying them on the same axis is worthless.&lt;BR /&gt;&lt;BR /&gt;I need to either&lt;BR /&gt;1. create a different chart for each host_type (and not worry about the actual value of count)&lt;BR /&gt;2. normalize the y axis so that instead of the literal count, the max peak for all histograms is 1 (or 100 or whatever)&lt;BR /&gt;&lt;BR /&gt;I think I'll need a foreach command somewhere, but not sure what's the best route forward. Maybe there's a command similar to count that I should be using instead.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 00:32:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Construct-multivariable-histogram-chart/m-p/629412#M218643</guid>
      <dc:creator>cool_pbenjamin</dc:creator>
      <dc:date>2023-02-03T00:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Construct multivariable histogram chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Construct-multivariable-histogram-chart/m-p/629414#M218644</link>
      <description>&lt;P&gt;You could do trellis view with independent y-axis, but it depends on the number of variants you have as to whether it looks good or not.&lt;/P&gt;&lt;P&gt;Alternatively normalising all data can be done with&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| chart count by duration_seconds host_type limit=0 span=1.0
| addtotals
| eval Total=Total-coalesce(tonumber(duration_seconds),0)
| foreach * [ eval "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"=if("&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;"="duration_seconds" OR "&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;"="Total", '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;', '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'/Total*100) ]
| fields - Total&lt;/LI-CODE&gt;&lt;P&gt;it's a bit messy with doing just addtotals for all fields, as that adds all totals and presumably your duration_seconds is numeric, so it will get included in the total counts. If you know host_type values, you can use those instead to avoid the "if" in the foreach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 00:55:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Construct-multivariable-histogram-chart/m-p/629414#M218644</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-03T00:55:05Z</dc:date>
    </item>
  </channel>
</rss>

