<?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: How can I use timechart with Where condition and stats? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-timechart-with-Where-condition-and-stats/m-p/646215#M223690</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/158935"&gt;@yeahnah&lt;/a&gt;&amp;nbsp;and just out of curiosity, is it possible to create a&amp;nbsp;&lt;SPAN&gt;Multi-Series Line Chart using 2 different queries that works by themselves?&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;1 line:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="something" source="*-value*" ("random value 1" OR "*random value 2*")
| bin span=1d _time
| stats count(eval(match(_raw, "random value 1"))) as value_1,
       count(eval(match(_raw, "random value 2"))) as value_2
       by _time source
| where value_1 &amp;gt; 0 AND value_2 &amp;gt; 0
| timechart span=1d dc(source) as unique_sources&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;2nd line chart:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="something" source="*-value*" ("random value 1" OR "*random value 3*" OR "*random value 4*" OR "*random value 5*")
| bin span=1d _time
| stats count(eval(match(_raw, "random value 1"))) as value_1,
       count(eval(match(_raw, "random value 3"))) as value_3,
       count(eval(match(_raw, "random value 4"))) as value_4,
       count(eval(match(_raw, "random value 5"))) as value_5,
       by _time source
| where value_1 &amp;gt; 0 AND (value_3 &amp;gt; 0 OR value_4 OR value_5)
| timechart span=1d dc(source) as unique_sources&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like it is easier just to split into to 2 billboards, but might be be better to have them in the same one (in case it is possible)&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jun 2023 21:01:29 GMT</pubDate>
    <dc:creator>Alanmas</dc:creator>
    <dc:date>2023-06-07T21:01:29Z</dc:date>
    <item>
      <title>How can I use timechart with Where condition and stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-timechart-with-Where-condition-and-stats/m-p/646008#M223643</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;&lt;BR /&gt;I am trying to figure out how to convert an table query into a histogram using timechart(), but I am having issues as no data is flowing (I read that is because when you use stats the value of _time disappear or something).&lt;BR /&gt;&lt;BR /&gt;Here is my old query:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;index="something" source="*-value*" ("random value 1" OR "*random value 2*")
| stats count(eval(match(_raw, "random value 1"))) as value_1,
       count(eval(match(_raw, "random value 2"))) as value_2
       by source
| where value_1 &amp;gt; 0 AND value_2 &amp;gt; 0
| table source&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;And this is what I have so far:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;index="something" source="*-value*" ("random value 1" OR "*random value 2*")
| stats count(eval(match(_raw, "random value 1"))) as value_1,
       count(eval(match(_raw, "random value 2"))) as value_2
       by source
| where value_1 &amp;gt; 0 AND value_2 &amp;gt; 0
| timechart span=1d dc(source) as unique_sources&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;But not data is flowing, I already tried other ways and I am sure should be something easy that I am not able to figure out &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 07:07:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-timechart-with-Where-condition-and-stats/m-p/646008#M223643</guid>
      <dc:creator>Alanmas</dc:creator>
      <dc:date>2023-06-07T07:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart with Where condition and stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-timechart-with-Where-condition-and-stats/m-p/646009#M223644</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257498"&gt;@Alanmas&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;That is correct, the stats command summarised/transforms the data stream, so if you want to use a field in subsequent commands then you must ensure the field is based by either grouping (BY clause) or using a function.&lt;BR /&gt;&lt;BR /&gt;In this case, you look to be summarising results on a daily bases so something like this might meet your needs&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="something" source="*-value*" ("random value 1" OR "*random value 2*")
| bin span=1d _time
| stats count(eval(match(_raw, "random value 1"))) as value_1,
       count(eval(match(_raw, "random value 2"))) as value_2
       by _time source
| where value_1 &amp;gt; 0 AND value_2 &amp;gt; 0
| timechart span=1d dc(source) as unique_sources&lt;/LI-CODE&gt;&lt;P&gt;Hope that helps&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 00:09:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-timechart-with-Where-condition-and-stats/m-p/646009#M223644</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-06-07T00:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart with Where condition and stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-timechart-with-Where-condition-and-stats/m-p/646011#M223645</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/158935"&gt;@yeahnah&lt;/a&gt;&amp;nbsp;THANK YOU!!!&lt;BR /&gt;&lt;BR /&gt;I did not know the usage of bin + by _time&lt;BR /&gt;&lt;BR /&gt;This is exactly what I was looking for!! YOU ARE AWESOME &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 02:45:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-timechart-with-Where-condition-and-stats/m-p/646011#M223645</guid>
      <dc:creator>Alanmas</dc:creator>
      <dc:date>2023-06-07T02:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use timechart with Where condition and stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-timechart-with-Where-condition-and-stats/m-p/646215#M223690</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/158935"&gt;@yeahnah&lt;/a&gt;&amp;nbsp;and just out of curiosity, is it possible to create a&amp;nbsp;&lt;SPAN&gt;Multi-Series Line Chart using 2 different queries that works by themselves?&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;1 line:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="something" source="*-value*" ("random value 1" OR "*random value 2*")
| bin span=1d _time
| stats count(eval(match(_raw, "random value 1"))) as value_1,
       count(eval(match(_raw, "random value 2"))) as value_2
       by _time source
| where value_1 &amp;gt; 0 AND value_2 &amp;gt; 0
| timechart span=1d dc(source) as unique_sources&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;2nd line chart:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="something" source="*-value*" ("random value 1" OR "*random value 3*" OR "*random value 4*" OR "*random value 5*")
| bin span=1d _time
| stats count(eval(match(_raw, "random value 1"))) as value_1,
       count(eval(match(_raw, "random value 3"))) as value_3,
       count(eval(match(_raw, "random value 4"))) as value_4,
       count(eval(match(_raw, "random value 5"))) as value_5,
       by _time source
| where value_1 &amp;gt; 0 AND (value_3 &amp;gt; 0 OR value_4 OR value_5)
| timechart span=1d dc(source) as unique_sources&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like it is easier just to split into to 2 billboards, but might be be better to have them in the same one (in case it is possible)&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 21:01:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-timechart-with-Where-condition-and-stats/m-p/646215#M223690</guid>
      <dc:creator>Alanmas</dc:creator>
      <dc:date>2023-06-07T21:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use timechart with Where condition and stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-timechart-with-Where-condition-and-stats/m-p/646219#M223691</link>
      <description>&lt;P&gt;Just to answer my own question, yes it is possible just adding union between them &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 21:27:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-timechart-with-Where-condition-and-stats/m-p/646219#M223691</guid>
      <dc:creator>Alanmas</dc:creator>
      <dc:date>2023-06-07T21:27:47Z</dc:date>
    </item>
  </channel>
</rss>

