<?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: Create a Time Table with multiple 'by' fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Create-a-Time-Table-with-multiple-by-fields/m-p/309017#M92674</link>
    <description>&lt;P&gt;who knew by would accept two terms separated by a space. Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 23 Feb 2018 07:41:02 GMT</pubDate>
    <dc:creator>dreeck</dc:creator>
    <dc:date>2018-02-23T07:41:02Z</dc:date>
    <item>
      <title>Create a Time Table with multiple 'by' fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-Time-Table-with-multiple-by-fields/m-p/309015#M92672</link>
      <description>&lt;P&gt;I need a table that looks like a chart containing multiple 'by' values.&lt;/P&gt;

&lt;P&gt;sample output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;time_bin, farmName, errorCount
12:05      , farmOne   , 7
12:05      , farmTwo   , 6
12:10      ,farmOne    ,8
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So far I'm doing this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prod-* sourcetype=fruits msg="ripened*" | 
bin _time span=5m | 
eval error = if(like(sev,"ERROR"),1,null) |
eval warn = if(like(sev,"WARN"),1,null) |
eval info = if(like(sev,"INFO"),1,null) |
eval farm = case(
like(index,"%farm1"),"farmOne",
like(index,"%farm2"),"farmTwo",") |
stats values(farm), count(errors) by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This &lt;EM&gt;mostly&lt;/EM&gt; gets me what I want, except I get a multi-value field for farm. So I get &lt;/P&gt;

&lt;P&gt;12:05      , farmOne FarmTwo, 13 instead of what I want. &lt;/P&gt;

&lt;P&gt;what am I missing?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 21:11:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-Time-Table-with-multiple-by-fields/m-p/309015#M92672</guid>
      <dc:creator>dreeck</dc:creator>
      <dc:date>2018-02-22T21:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Time Table with multiple 'by' fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-Time-Table-with-multiple-by-fields/m-p/309016#M92673</link>
      <description>&lt;P&gt;You can try stats by _time and farm to separate it by _time and with farm name like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|stats values(farm), count(errors) by _time farm
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if this wont work then try below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|makemv farm|mvexpand farm
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Feb 2018 01:46:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-Time-Table-with-multiple-by-fields/m-p/309016#M92673</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-23T01:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Time Table with multiple 'by' fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-Time-Table-with-multiple-by-fields/m-p/309017#M92674</link>
      <description>&lt;P&gt;who knew by would accept two terms separated by a space. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 07:41:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-Time-Table-with-multiple-by-fields/m-p/309017#M92674</guid>
      <dc:creator>dreeck</dc:creator>
      <dc:date>2018-02-23T07:41:02Z</dc:date>
    </item>
  </channel>
</rss>

