<?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: Re-use host field in Timechart for count aggregation in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Re-use-host-field-in-Timechart-for-count-aggregation/m-p/405037#M6977</link>
    <description>&lt;P&gt;See the answer by @niketnilay on this one, which includes the full code for a similar solution.  &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/623803/trellis-display-of-two-values.html"&gt;https://answers.splunk.com/answers/623803/trellis-display-of-two-values.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;However, I believe you may need to swap the order of your fields.  That is, the "by" field may need to be &lt;CODE&gt;by host&lt;/CODE&gt; if you want the trellis to break the results by host. Try it the way you have it and see if it works.  If not, then swap it and see if that works.  &lt;/P&gt;</description>
    <pubDate>Sat, 11 Aug 2018 06:02:22 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2018-08-11T06:02:22Z</dc:date>
    <item>
      <title>Re-use host field in Timechart for count aggregation</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Re-use-host-field-in-Timechart-for-count-aggregation/m-p/405036#M6976</link>
      <description>&lt;P&gt;I am attempting to create a dynamic timecharted trellis dashboard panel that only shows an aggregation &lt;CODE&gt;by host&lt;/CODE&gt; based on which &lt;CODE&gt;host&lt;/CODE&gt; fields are present in the main search.&lt;/P&gt;

&lt;P&gt;As an example, the below shows two trellis panels, split &lt;CODE&gt;by sourcetype&lt;/CODE&gt; using a statically assigned &lt;CODE&gt;host&lt;/CODE&gt; names.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype=* host=host1 OR host=host2 
| timechart span=1s count(eval(host == "host1")) as "host1" count(eval(host == "host2")) as "host2" count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I would like is the number of Trellis panels (aggregated &lt;CODE&gt;by host&lt;/CODE&gt;) to shrink or grow based on the number of hosts listed in the primary search.&lt;/P&gt;

&lt;P&gt;Programmatically this would be something like a for loop over the host aggregation to create multiple panels, depending on the number of &lt;CODE&gt;host&lt;/CODE&gt; values present.&lt;/P&gt;

&lt;P&gt;i.e. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype=* host=host1 OR host=host2 
| timechart span=1s count(eval(host == )) as "" count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With the expanded search evaluating to something like the below, assuming 3 hosts.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype=* host=host1 OR host=host2 OR host=3
| timechart span=1s count(eval(host == "host1")) as "host1" count(eval(host == "host2")) as "host2" count(eval(host == "host3")) as "host3" count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help would be appreciated!&lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 22:08:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Re-use-host-field-in-Timechart-for-count-aggregation/m-p/405036#M6976</guid>
      <dc:creator>joshuagray</dc:creator>
      <dc:date>2018-08-09T22:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Re-use host field in Timechart for count aggregation</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Re-use-host-field-in-Timechart-for-count-aggregation/m-p/405037#M6977</link>
      <description>&lt;P&gt;See the answer by @niketnilay on this one, which includes the full code for a similar solution.  &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/623803/trellis-display-of-two-values.html"&gt;https://answers.splunk.com/answers/623803/trellis-display-of-two-values.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;However, I believe you may need to swap the order of your fields.  That is, the "by" field may need to be &lt;CODE&gt;by host&lt;/CODE&gt; if you want the trellis to break the results by host. Try it the way you have it and see if it works.  If not, then swap it and see if that works.  &lt;/P&gt;</description>
      <pubDate>Sat, 11 Aug 2018 06:02:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Re-use-host-field-in-Timechart-for-count-aggregation/m-p/405037#M6977</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-11T06:02:22Z</dc:date>
    </item>
  </channel>
</rss>

