<?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: Splunk DB Connect 1: How to use &amp;quot;timechart avg()&amp;quot; in a dbquery search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-quot-timechart-avg-quot-in-a/m-p/254944#M189423</link>
    <description>&lt;P&gt;So, this query completes successfully&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbquery "TQOMA" "SELECT "Time" , "Virtual_Machine" , "ready" FROM TQSTDBO.CPUBYVM where "Virtual_Machine" BETWEEN 'vW7NTXMCSOMA001' AND 'vW7NTXMCSOMA025'"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This query completes with no results found&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbquery "TQOMA" "SELECT "Time" , "Virtual_Machine" , "ready" FROM TQSTDBO.CPUBYVM where "Virtual_Machine" BETWEEN 'vW7NTXMCSOMA001' AND 'vW7NTXMCSOMA025'" | search Time&amp;gt;strptime("01/26/16 09:25:00","%m/%d/%y %H:%M:%S") AND Time&amp;lt;strptime("01/26/16 09:55:00","%m/%d/%y %H:%M:%S") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Jan 2016 13:12:56 GMT</pubDate>
    <dc:creator>mark_chuman</dc:creator>
    <dc:date>2016-01-27T13:12:56Z</dc:date>
    <item>
      <title>Splunk DB Connect 1: How to use "timechart avg()" in a dbquery search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-quot-timechart-avg-quot-in-a/m-p/254940#M189419</link>
      <description>&lt;P&gt;This search works fine:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"DBOMA" "SELECT "Time" , "Virtual_Machine" , "ready" FROM DBSTDBO.CPUBYVM where "Virtual_Machine" BETWEEN 'vmname001' AND 'vmname025'" | eval Time=strftime(Time,"%m/%d/%y %H:%M:%S") | search Time&amp;gt;"01/26/16 09:25:00" | search Time&amp;lt;"01/26/16 09:55:00"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But this search below fails with no results found.  I've used timechart avg successfully before, so not sure if it's snagging on something because it's a dbquery.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"DBOMA" "SELECT "Time" , "Virtual_Machine" , "ready" FROM DBSTDBO.CPUBYVM where "Virtual_Machine" BETWEEN 'vmname001' AND 'vmname025'" | eval Time=strftime(Time,"%m/%d/%y %H:%M:%S") | search Time&amp;gt;"01/26/16 09:25:00" | search Time&amp;lt;"01/26/16 09:55:00" | timechart avg("ready") by Virtual_Machine
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jan 2016 22:04:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-quot-timechart-avg-quot-in-a/m-p/254940#M189419</guid>
      <dc:creator>mark_chuman</dc:creator>
      <dc:date>2016-01-26T22:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to use "timechart avg()" in a dbquery search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-quot-timechart-avg-quot-in-a/m-p/254941#M189420</link>
      <description>&lt;P&gt;hi mark.chuman,&lt;/P&gt;

&lt;P&gt;if &lt;CODE&gt;ready&lt;/CODE&gt; is one field, try replace &lt;CODE&gt;| timechart avg("ready") by Virtual_Machine&lt;/CODE&gt; by &lt;CODE&gt;| timechart avg(ready) by Virtual_Machine&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 22:15:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-quot-timechart-avg-quot-in-a/m-p/254941#M189420</guid>
      <dc:creator>gyslainlatsa</dc:creator>
      <dc:date>2016-01-26T22:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to use "timechart avg()" in a dbquery search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-quot-timechart-avg-quot-in-a/m-p/254942#M189421</link>
      <description>&lt;P&gt;The reason timechart is failing as it expects a fields with name "_time" in epoch format timestmap and which is not present in your output of dbquery. Try something like this (also change the comparison of date in epoch format)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"DBOMA" "SELECT "Time" , "Virtual_Machine" , "ready" FROM DBSTDBO.CPUBYVM where "Virtual_Machine" BETWEEN 'vmname001' AND 'vmname025'"  | search Time&amp;gt;strptime("01/26/16 09:25:00","%m/%d/%y %H:%M:%S") AND Time&amp;lt;strptime("01/26/16 09:55:00","%m/%d/%y %H:%M:%S") | rename Time as _time | timechart avg("ready") by Virtual_Machine
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jan 2016 22:32:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-quot-timechart-avg-quot-in-a/m-p/254942#M189421</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-01-26T22:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to use "timechart avg()" in a dbquery search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-quot-timechart-avg-quot-in-a/m-p/254943#M189422</link>
      <description>&lt;P&gt;thanks.  tried this before and it comes up with same result as original query&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 13:09:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-quot-timechart-avg-quot-in-a/m-p/254943#M189422</guid>
      <dc:creator>mark_chuman</dc:creator>
      <dc:date>2016-01-27T13:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to use "timechart avg()" in a dbquery search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-quot-timechart-avg-quot-in-a/m-p/254944#M189423</link>
      <description>&lt;P&gt;So, this query completes successfully&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbquery "TQOMA" "SELECT "Time" , "Virtual_Machine" , "ready" FROM TQSTDBO.CPUBYVM where "Virtual_Machine" BETWEEN 'vW7NTXMCSOMA001' AND 'vW7NTXMCSOMA025'"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This query completes with no results found&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbquery "TQOMA" "SELECT "Time" , "Virtual_Machine" , "ready" FROM TQSTDBO.CPUBYVM where "Virtual_Machine" BETWEEN 'vW7NTXMCSOMA001' AND 'vW7NTXMCSOMA025'" | search Time&amp;gt;strptime("01/26/16 09:25:00","%m/%d/%y %H:%M:%S") AND Time&amp;lt;strptime("01/26/16 09:55:00","%m/%d/%y %H:%M:%S") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Jan 2016 13:12:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-quot-timechart-avg-quot-in-a/m-p/254944#M189423</guid>
      <dc:creator>mark_chuman</dc:creator>
      <dc:date>2016-01-27T13:12:56Z</dc:date>
    </item>
  </channel>
</rss>

