<?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 How to merge two searches and make a single timechart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-searches-and-make-a-single-timechart/m-p/219138#M176217</link>
    <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;i'm trying to merge/join 2 searches into 1, and create a table of the data.&lt;/P&gt;

&lt;P&gt;this is my starting query:&lt;/P&gt;

&lt;P&gt;index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla | join type=left max=1 [search index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla2] | table _time,ID,field1,field2,field3,field4,field5&lt;/P&gt;

&lt;P&gt;with this query i can get the minutely data.&lt;/P&gt;

&lt;P&gt;what i need is an hourly data, something like timechart span=1h does.&lt;BR /&gt;
but my problem is that i need an hourly data for every hour for fields1-5, so timechart is not good for me.&lt;BR /&gt;
(e.g i need timechart max(avg(field1),field2,...,field5) by ID but timechart supports only one field)&lt;/P&gt;

&lt;P&gt;i have tried using bucket like this:&lt;/P&gt;

&lt;P&gt;index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla | join type=left max=1 [search index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla2] | bucket _time span=1h | table _time,ID,field1,field2,field3,field4,field5&lt;/P&gt;

&lt;P&gt;but what i get is the same time for all the lines.&lt;/P&gt;

&lt;P&gt;my wish is to have something like this:&lt;BR /&gt;
index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla | join type=left max=1 [search index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla2] | table _time,ID,field1,field2,field3,field4,field5 | timechart avg(field1),avg(field2),avg(field3),avg(field4),avg(field5) by ID span=1h&lt;/P&gt;

&lt;P&gt;bu again, timechart does not support multiple fields.&lt;/P&gt;

&lt;P&gt;so my question is:&lt;BR /&gt;
1. how to merge 2 searches into one large table?&lt;BR /&gt;
2. how to make the span of that large table become 1h?&lt;/P&gt;

&lt;P&gt;Thank you!!&lt;/P&gt;</description>
    <pubDate>Mon, 14 Nov 2016 07:38:09 GMT</pubDate>
    <dc:creator>naty</dc:creator>
    <dc:date>2016-11-14T07:38:09Z</dc:date>
    <item>
      <title>How to merge two searches and make a single timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-searches-and-make-a-single-timechart/m-p/219138#M176217</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;i'm trying to merge/join 2 searches into 1, and create a table of the data.&lt;/P&gt;

&lt;P&gt;this is my starting query:&lt;/P&gt;

&lt;P&gt;index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla | join type=left max=1 [search index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla2] | table _time,ID,field1,field2,field3,field4,field5&lt;/P&gt;

&lt;P&gt;with this query i can get the minutely data.&lt;/P&gt;

&lt;P&gt;what i need is an hourly data, something like timechart span=1h does.&lt;BR /&gt;
but my problem is that i need an hourly data for every hour for fields1-5, so timechart is not good for me.&lt;BR /&gt;
(e.g i need timechart max(avg(field1),field2,...,field5) by ID but timechart supports only one field)&lt;/P&gt;

&lt;P&gt;i have tried using bucket like this:&lt;/P&gt;

&lt;P&gt;index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla | join type=left max=1 [search index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla2] | bucket _time span=1h | table _time,ID,field1,field2,field3,field4,field5&lt;/P&gt;

&lt;P&gt;but what i get is the same time for all the lines.&lt;/P&gt;

&lt;P&gt;my wish is to have something like this:&lt;BR /&gt;
index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla | join type=left max=1 [search index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla2] | table _time,ID,field1,field2,field3,field4,field5 | timechart avg(field1),avg(field2),avg(field3),avg(field4),avg(field5) by ID span=1h&lt;/P&gt;

&lt;P&gt;bu again, timechart does not support multiple fields.&lt;/P&gt;

&lt;P&gt;so my question is:&lt;BR /&gt;
1. how to merge 2 searches into one large table?&lt;BR /&gt;
2. how to make the span of that large table become 1h?&lt;/P&gt;

&lt;P&gt;Thank you!!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 07:38:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-searches-and-make-a-single-timechart/m-p/219138#M176217</guid>
      <dc:creator>naty</dc:creator>
      <dc:date>2016-11-14T07:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge two searches and make a single timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-searches-and-make-a-single-timechart/m-p/219139#M176218</link>
      <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla | join type=left max=1 [search index=myapp source="mysource" earliest=1477810800 latest=1477821600 | extract REPORT-blabla2] | table _time,ID,field1,field2,field3,field4,field5 | bucket span=1h _time 
| stats avg(*) as * by _time ID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Nov 2016 17:02:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-searches-and-make-a-single-timechart/m-p/219139#M176218</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-11-14T17:02:51Z</dc:date>
    </item>
  </channel>
</rss>

