<?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: two searches in pivot in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311523#M5730</link>
    <description>&lt;P&gt;Are you looking for the values of id and status, or counts, or what? &lt;/P&gt;</description>
    <pubDate>Mon, 20 Feb 2017 21:54:40 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-02-20T21:54:40Z</dc:date>
    <item>
      <title>two searches in pivot</title>
      <link>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311518#M5725</link>
      <description>&lt;P&gt;I have index=webserver_logs and source=security_logs and can search both in a single query:&lt;BR /&gt;
index=webserver_logs | append [search source=security_logs]&lt;BR /&gt;
I get a table with all events and just select webserver_logs.status and security_logs.id&lt;/P&gt;

&lt;P&gt;But If I want to build a column chart with split rows = _time and column values count of status and count of id the table looks exactly what I need. The column chart will only display one of the values. As soon I try to add another colour to the Y-Axis only one of the values is graphed. Using both as a single value the graph is just fine.&lt;/P&gt;

&lt;P&gt;How do I get them both displayed together?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:56:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311518#M5725</guid>
      <dc:creator>julz0815</dc:creator>
      <dc:date>2020-09-29T12:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: two searches in pivot</title>
      <link>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311519#M5726</link>
      <description>&lt;P&gt;It is unclear where you doing the search you describe.  Can you share the actual pivot query you are running.&lt;/P&gt;

&lt;P&gt;The raw search query you posted is not part of Pivot or a datamodel in Splunk and could not be allowed as one because you cannot use things like &lt;CODE&gt;append&lt;/CODE&gt; in a datamodel definition.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 17:09:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311519#M5726</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-02-20T17:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: two searches in pivot</title>
      <link>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311520#M5727</link>
      <description>&lt;P&gt;I suspect you are not actually using a pivot.  Also, you don't have to use append for that query, just use "OR" in the initial search. This strategy avoids the limit of 50K records returned from a subsearch.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=webserver_logs) OR (index=* AND source=security_logs)
| eval status=case(index==webserver_logs,status) 
| eval id=case(source==security_logs,id) 
| table _time status id
| timechart count(status) as statuscount count(id) as idcount
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This returns data summed by time that you can use in a stacked bar chart or a line chart.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Below is some code that generates test data that I used to check my work above.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start="01/25/2017:23:00:00" end="01/27/2017:01:00:00" increment=23m 
| eval status="A"
| append
    [| gentimes start="01/26/2017:03:00:00" end="01/26/2017:21:00:00" increment=47m 
    | eval status="B"]
| append
    [| gentimes start="01/26/2017:01:17:00" end="01/26/2017:23:18:00" increment=21m 
    | eval status="C"]
| append
    [| gentimes start="01/26/2017:03:00:00" end="01/26/2017:14:00:00" increment=19m 
    | streamstats count as id ]
| append
    [| gentimes start="01/26/2017:01:41:00" end="01/26/2017:23:18:00" increment=55m 
    | streamstats count as id ]
| bin starttime span=1h 
| rename starttime as _time
| timechart count(status) as statuscount count(id) as idcount
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Feb 2017 18:51:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311520#M5727</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-20T18:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: two searches in pivot</title>
      <link>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311521#M5728</link>
      <description>&lt;P&gt;from search index=webserver_logs | append [search source=security_logs] | table _time status id I was going to  tab visualisation and then choosing column bar &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:56:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311521#M5728</guid>
      <dc:creator>julz0815</dc:creator>
      <dc:date>2020-09-29T12:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: two searches in pivot</title>
      <link>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311522#M5729</link>
      <description>&lt;P&gt;interestingly statuscount and idcount always show 0, the amount of events found is ok as well the time column seem to show the correct values.&lt;BR /&gt;
Removing the eval parts seems to do the trick, I guess as there is most probably  data in webserver_logs but not in security_logs the same time. And visualization works like a charm as well.&lt;/P&gt;

&lt;P&gt;Thanks for helping!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:56:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311522#M5729</guid>
      <dc:creator>julz0815</dc:creator>
      <dc:date>2020-09-29T12:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: two searches in pivot</title>
      <link>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311523#M5730</link>
      <description>&lt;P&gt;Are you looking for the values of id and status, or counts, or what? &lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 21:54:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311523#M5730</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-20T21:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: two searches in pivot</title>
      <link>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311524#M5731</link>
      <description>&lt;P&gt;looking for counts of both to compare and show a percentage&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 22:14:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311524#M5731</guid>
      <dc:creator>julz0815</dc:creator>
      <dc:date>2017-02-20T22:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: two searches in pivot</title>
      <link>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311525#M5732</link>
      <description>&lt;P&gt;np.  if removing the evals worked, then great!   that case statement should work with a table command and stats... but technically, by my own test code below, you didn't need any of those three lines 2-4 in my first sample. &lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 02:44:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/two-searches-in-pivot/m-p/311525#M5732</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-21T02:44:02Z</dc:date>
    </item>
  </channel>
</rss>

