<?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: appendcols and line dates from 2 searches in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261159#M78390</link>
    <description>&lt;P&gt;tks, I got that to work now &lt;CODE&gt;search1 | append [search search2] | stats values(*) as * by _time&lt;/CODE&gt; and the graphing for some reason works better compared with the join option(a q i asked &lt;A href="https://answers.splunk.com/answers/386457/why-am-i-unable-to-produce-a-stacked-chart-and-joi.html"&gt;here&lt;/A&gt;). which leads me to another question "&lt;A href="https://answers.splunk.com/answers/387384/can-i-have-a-chartoverlay-with-2-serieses-stacked.html?minQuestionBodyLength=80"&gt;can i have a chartoverlay, with 2 serieses, stacked in splunk graph&lt;/A&gt;"&lt;/P&gt;</description>
    <pubDate>Thu, 31 Mar 2016 20:37:16 GMT</pubDate>
    <dc:creator>HattrickNZ</dc:creator>
    <dc:date>2016-03-31T20:37:16Z</dc:date>
    <item>
      <title>appendcols and line dates from 2 searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261149#M78380</link>
      <description>&lt;P&gt;i have 2 searches &lt;/P&gt;

&lt;P&gt;1 gives me this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    _time   kpi1    predictkpi1
1   2010-09 179.539643   
2   2010-10 239.270968   
3   2010-11 307.206667  299.002293
4   2010-12 405.039032  370.322797954
...
96  2018-08     21813.7910836
97  2018-09     22041.520084
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2 gives me this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    _time   kpi2    predictkpi2
1   2015-07 5761.043548  
2   2015-08 6226.990968  
3   2015-09 6439.014667 6692.938388
....
37  2018-07     27442.3650311
38  2018-08     28051.5290532
39  2018-09     28660.6930754
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am using appendcols to append them together but dates are not lining up. for instance &lt;CODE&gt;2010-09&lt;/CODE&gt; lines up with &lt;CODE&gt;2015-07&lt;/CODE&gt; row. ideall y want &lt;CODE&gt;2015-07&lt;/CODE&gt; to line up with &lt;CODE&gt;2015-07&lt;/CODE&gt;. How can I get the dates to lineup? &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EDID1&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="stacked chart not working as it should!!"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1175iFFAA102828EEDE4C/image-size/large?v=v2&amp;amp;px=999" role="button" title="stacked chart not working as it should!!" alt="stacked chart not working as it should!!" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 01:35:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261149#M78380</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2016-03-24T01:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols and line dates from 2 searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261150#M78381</link>
      <description>&lt;P&gt;Thats the default behaviour of appendcols (just appending columns row by row without any comparison/matching). For your scenario, try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search1 | append [search search2] | stats values(*) as * by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More details on append/appendcols functionality&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/144351/what-are-the-differences-between-append-appendpipe.html"&gt;https://answers.splunk.com/answers/144351/what-are-the-differences-between-append-appendpipe.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 05:54:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261150#M78381</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-24T05:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols and line dates from 2 searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261151#M78382</link>
      <description>&lt;P&gt;can you send me your two  searches ?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 11:50:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261151#M78382</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2016-03-24T11:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols and line dates from 2 searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261152#M78383</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
put your search in this form using appendcols command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal|eval date1=strftime(_time, "%Y-%m")|stats count(sourcetype) as count1 by date1 , source|table date1 source count1 |appendcols[search index=_* and index!=_internal|eval date2=strftime(_time, "%Y-%m")|stats count(user) as count2 by date2 , sourcetype|table date2 sourcetype count2]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Look at result&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 12:36:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261152#M78383</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2016-03-24T12:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols and line dates from 2 searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261153#M78384</link>
      <description>&lt;P&gt;this gives me the below: but maybe i am missing something. how do i allign dat1 and date2? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date1   source  count1  count2  date2   sourcetype
1   2016-02 C:\Apps\Splunk\var\log\splunk\conf.log  1   0   2016-03 kvstore
2   2016-02 C:\Apps\Splunk\var\log\splunk\metrics.log   63857            
3   2016-02 C:\Apps\Splunk\var\log\splunk\mongod.log    150          
4   2016-02 C:\Apps\Splunk\var\log\splunk\scheduler.log 39           
5   2016-02 C:\Apps\Splunk\var\log\splunk\splunkd-utility.log   13           
6   2016-02 C:\Apps\Splunk\var\log\splunk\splunkd.log   853          
7   2016-02 C:\Apps\Splunk\var\log\splunk\splunkd_access.log    396          
8   2016-02 C:\Apps\Splunk\var\log\splunk\splunkd_ui_access.log 24763            
9   2016-02 C:\Apps\Splunk\var\log\splunk\web_access.log    226          
10  2016-02 C:\Apps\Splunk\var\log\splunk\web_service.log   309          
11  2016-03 C:\Apps\Splunk\var\log\splunk\conf.log  29           
12  2016-03 C:\Apps\Splunk\var\log\splunk\metrics.log   1601158          
13  2016-03 C:\Apps\Splunk\var\log\splunk\metrics.log.1 293          
14  2016-03 C:\Apps\Splunk\var\log\splunk\mongod.log    2822             
15  2016-03 C:\Apps\Splunk\var\log\splunk\scheduler.log 1030             
16  2016-03 C:\Apps\Splunk\var\log\splunk\splunkd-utility.log   377          
17  2016-03 C:\Apps\Splunk\var\log\splunk\splunkd.log   15553            
18  2016-03 C:\Apps\Splunk\var\log\splunk\splunkd_access.log    4491             
19  2016-03 C:\Apps\Splunk\var\log\splunk\splunkd_ui_access.log 113037           
20  2016-03 C:\Apps\Splunk\var\log\splunk\web_access.log    922          
21  2016-03 C:\Apps\Splunk\var\log\splunk\web_service.log   6913     
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Mar 2016 21:36:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261153#M78384</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2016-03-28T21:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols and line dates from 2 searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261154#M78385</link>
      <description>&lt;P&gt;The appendcols will only be useful if the order of the common column (and name) is same in both result set. Which clearly not the case for your resultset. You can use append-stats combination, as suggested in my answer OR can use less efficient option of &lt;CODE&gt;| join type=outer&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 21:47:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261154#M78385</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-28T21:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols and line dates from 2 searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261155#M78386</link>
      <description>&lt;P&gt;I could not get this to work.&lt;/P&gt;

&lt;P&gt;the order of the searches give a different result, but ultimately the dates did not align. I try to explain the results below.&lt;/P&gt;

&lt;P&gt;search1 - 2010-09 to future date &lt;BR /&gt;
search2 - 2015-07 to future date &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search1 | append [search search2] | stats values(*) as * by _time&lt;/CODE&gt; gives 2010-09 to future date values with  2015-07 from search 2 alligned with 2010-09  from search1 &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search2 | append [search search1] | stats values(*) as * by _time&lt;/CODE&gt; gives 2015-07 to future date values with   2010-09 from search 1 alligned with 2015-07  from search2&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 21:51:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261155#M78386</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2016-03-28T21:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols and line dates from 2 searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261156#M78387</link>
      <description>&lt;P&gt;maybe I should use join? how do I join using the _time column from the 2 searches to line up?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 22:26:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261156#M78387</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2016-03-28T22:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols and line dates from 2 searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261157#M78388</link>
      <description>&lt;P&gt;@somesoni2&lt;/P&gt;

&lt;P&gt;got this to work &lt;BR /&gt;
&lt;CODE&gt;search1 | join type=outer _time [search search2] |&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;the problem now that the chart is not doing a stacked area chart for all 4 series in the graph...sigh!!&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://tinypic.com/m/j6o61f/3" alt="picture of staked chart that is not completely stacked" /&gt; (see my edit1 in question above)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 00:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261157#M78388</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2016-03-29T00:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols and line dates from 2 searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261158#M78389</link>
      <description>&lt;P&gt;If the join has worked, the append-stats should've worked too &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 23:06:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261158#M78389</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-29T23:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols and line dates from 2 searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261159#M78390</link>
      <description>&lt;P&gt;tks, I got that to work now &lt;CODE&gt;search1 | append [search search2] | stats values(*) as * by _time&lt;/CODE&gt; and the graphing for some reason works better compared with the join option(a q i asked &lt;A href="https://answers.splunk.com/answers/386457/why-am-i-unable-to-produce-a-stacked-chart-and-joi.html"&gt;here&lt;/A&gt;). which leads me to another question "&lt;A href="https://answers.splunk.com/answers/387384/can-i-have-a-chartoverlay-with-2-serieses-stacked.html?minQuestionBodyLength=80"&gt;can i have a chartoverlay, with 2 serieses, stacked in splunk graph&lt;/A&gt;"&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 20:37:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261159#M78390</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2016-03-31T20:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: appendcols and line dates from 2 searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261160#M78391</link>
      <description>&lt;P&gt;credit to @somesoni2 and @chimell above for getting this to work&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;NOTE&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search1 | append [search search2] | stats values(*) as * by _time&lt;/CODE&gt;  gives (this seems more better at doing charting, stackeing for example, compared to the one below. It also does not show the year along the axis as well as the one below). &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1173i8AB7CBA19C3C9D3B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search1 | join type=outer _time [search search2] |&lt;/CODE&gt; gives &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1174i7374B9FABE86F039/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Interesting that they give the same results but the graphing capability seems a bit different. &lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 20:56:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/appendcols-and-line-dates-from-2-searches/m-p/261160#M78391</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2016-03-31T20:56:07Z</dc:date>
    </item>
  </channel>
</rss>

