<?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 to define a X axis and submit different datasets in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275744#M83179</link>
    <description>&lt;P&gt;That is exactly why I said to show me  a minimal set of your actual raw events.  If you will provide me with that information (forget about Splunk entirely), we will be able to give you a search that does it.&lt;/P&gt;</description>
    <pubDate>Tue, 31 May 2016 11:54:03 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2016-05-31T11:54:03Z</dc:date>
    <item>
      <title>How to define a X axis and submit different datasets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275739#M83174</link>
      <description>&lt;P&gt;Hello I want to Display the &lt;CODE&gt;CPU used&lt;/CODE&gt; from a Server depending on the users are working on that Server for several Servers.&lt;BR /&gt;
It is working fine for the following query for one server:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="User_Index" | timechart span=5m values(Servername) AS Severname_User | appendcols [ search index="CPU_Index" | timechart span=5m avg(Servername) as Servername_CPU] | chart avg(Servername_CPU) AS Servername_CPU over Servername_User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but I wanna do that for multiple &lt;CODE&gt;server&lt;/CODE&gt; in one Chart; something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| timechart span=5m avg(Severname_CPU) by Server ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but instead over &lt;CODE&gt;_time&lt;/CODE&gt; I would like to have that result depending on the &lt;CODE&gt;users on the Server&lt;/CODE&gt;. So I Need a X axis with something like &lt;CODE&gt;1 to 10000&lt;/CODE&gt; and different sets of datapoints depending on the &lt;CODE&gt;servername&lt;/CODE&gt; like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;X=ServernameA_Users Y=ServernameA_CPU
X=ServernameB_Users Y=ServernameB_CPU
X=ServernameC_Users Y=ServernameC_CPU
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and so on........&lt;/P&gt;

&lt;P&gt;but be Aware that &lt;CODE&gt;Servername%&lt;/CODE&gt; is a whole column, so it's not just a Data Point, it is a set of Points, or a total graph.&lt;/P&gt;

&lt;P&gt;Is there  a possibility to create a Chart like that?&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2016 13:20:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275739#M83174</guid>
      <dc:creator>undercoverbroth</dc:creator>
      <dc:date>2016-05-30T13:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a X axis and submit different datasets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275740#M83175</link>
      <description>&lt;P&gt;I do not think anyone will understand your situation without more explicit details.  Create a minimal sample dataset and show us those events.  The mockup the desired output and show us that.  Maybe also include some simple math if necessary.&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2016 13:52:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275740#M83175</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-05-30T13:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a X axis and submit different datasets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275741#M83176</link>
      <description>&lt;P&gt;Basically I have different Servers with users working on them. I Monitor the users working on the Servers and the CPU used on the Servers.&lt;BR /&gt;
I can create timecharts like: ....|timechart values(CPU) by host.... this returns the CPU used per Server over the selected time Frame.&lt;/P&gt;

&lt;P&gt;Also I can create a timechart like: ......|timechart dc(Users) by host...... this Returns the distinct Count of users working on the Servers over the selected timeframe.&lt;/P&gt;

&lt;P&gt;But I wanna have a Chart where I can see the used CPU over the amount of users working for each Server.&lt;BR /&gt;
I created the Output I wanna have in a simple Excel sheet as you can see attached.&lt;/P&gt;

&lt;P&gt;Is there a possibility to create something like that in splunk. At the end I would like to have a dasboard like that.&lt;/P&gt;

&lt;P&gt;Scr&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/1425i4B55C904A5F1BA39/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2016 14:28:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275741#M83176</guid>
      <dc:creator>undercoverbroth</dc:creator>
      <dc:date>2016-05-30T14:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a X axis and submit different datasets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275742#M83177</link>
      <description>&lt;P&gt;Perfect.  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|noop | rename Comment AS "First, mockup sample data"
|stats count AS Servername
| eval Servername="Server A,Server B,Server C" | makemv delim="," Servername | mvexpand Servername
| eval Users-CPU=case((Servername="Server A"), "200::3,263::5,458::7,490::8,753::12,952::15",
                      (Servername="Server B"), "143::2,275::5,336::6,425::7,655::10,723::12",
                      (Servername="Server C"), "253::5,345::6,480::8,556::9,898::14,1073::18")
| makemv delim="," Users-CPU | mvexpand Users-CPU | rex field=Users-CPU "^(?&amp;lt;Users&amp;gt;\d+)::(?&amp;lt;CPU&amp;gt;\d+)$" | fields - Users-CPU
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You will have something else as your base search, of course.  Now you have 2 followon searches.&lt;/P&gt;

&lt;P&gt;This is for the visualization (select &lt;CODE&gt;Line Chart&lt;/CODE&gt; as your visualization type):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart avg(CPU) BY Users Servername
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is for your chart (select &lt;CODE&gt;Statistics Table&lt;/CODE&gt; as your visualization type):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart values(*) AS * BY Servername
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 May 2016 16:19:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275742#M83177</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-05-30T16:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a X axis and submit different datasets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275743#M83178</link>
      <description>&lt;P&gt;oh great thanks, that is definetly in the direction I wanna go.&lt;BR /&gt;
But how can I fill the different Severnames with data from a Splunk query. The example above was just to Show what I wanna do or see.&lt;BR /&gt;
At the end of the day, I wanna have a query which fills Server A and Server B and so on with data out of my Indexes.&lt;/P&gt;

&lt;P&gt;I am really new to splunk maybe my question is stupid but can I do something like:&lt;/P&gt;

&lt;P&gt;..... | eval Users-CPU=case((Servername="Server A"), "[query1]::[query2]",&lt;BR /&gt;
                    (Servername="Server B"), "[query3]::[query4]",&lt;BR /&gt;
                       (Servername="Server C"),  "[query3]::[query4]")......|.....&lt;/P&gt;

&lt;P&gt;and of course the quer* will return several rows of data.....&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2016 10:05:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275743#M83178</guid>
      <dc:creator>undercoverbroth</dc:creator>
      <dc:date>2016-05-31T10:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a X axis and submit different datasets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275744#M83179</link>
      <description>&lt;P&gt;That is exactly why I said to show me  a minimal set of your actual raw events.  If you will provide me with that information (forget about Splunk entirely), we will be able to give you a search that does it.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2016 11:54:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275744#M83179</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-05-31T11:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a X axis and submit different datasets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275745#M83180</link>
      <description>&lt;P&gt;Okay,&lt;/P&gt;

&lt;P&gt;basicly I created some summary Indexes which I fill with data. The columns are the &lt;CODE&gt;servernames&lt;/CODE&gt; and the values are depending on the summary index the value I wanna have.&lt;/P&gt;

&lt;P&gt;for example I have a summary index for &lt;CODE&gt;CPU used&lt;/CODE&gt;.&lt;BR /&gt;
If I search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary_cpu | timechart values(ServernameA) values(ServernameB) values(ServernameC)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it gives me the &lt;CODE&gt;CPU used&lt;/CODE&gt; on the &lt;CODE&gt;serverA&lt;/CODE&gt;, &lt;CODE&gt;ServerB&lt;/CODE&gt; and &lt;CODE&gt;ServerC&lt;/CODE&gt; over &lt;CODE&gt;time&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;also I can do a query over another index:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary_User | timechart values(ServernameA) values(ServernameB) values(ServernameC)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this Returns the &lt;CODE&gt;users&lt;/CODE&gt; on each Server over &lt;CODE&gt;time&lt;/CODE&gt; for the timeframe I set.&lt;/P&gt;

&lt;P&gt;Now I wanna have a Chart on which I can see the &lt;CODE&gt;CPU used&lt;/CODE&gt; over the &lt;CODE&gt;Users&lt;/CODE&gt; working on that &lt;CODE&gt;Server&lt;/CODE&gt;.&lt;BR /&gt;
So that means I wanna have a Dashboard with the &lt;CODE&gt;CPU used&lt;/CODE&gt; on the &lt;CODE&gt;Y-axis&lt;/CODE&gt; and the &lt;CODE&gt;Users&lt;/CODE&gt; on the &lt;CODE&gt;X-axis&lt;/CODE&gt; for each &lt;CODE&gt;Server&lt;/CODE&gt; in one Chart.&lt;/P&gt;

&lt;P&gt;Also as I saw the Output from your Suggestion and I noticed that it just takes the data Points and does not create a linear x axis.&lt;BR /&gt;
for example if I have three data Points like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;200::5
250::6
800::15
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it creates three Points which are each takes exactly a third of the Chart.&lt;BR /&gt;
Is it possible for splunk creates a &lt;CODE&gt;X-axis&lt;/CODE&gt; from &lt;CODE&gt;0&lt;/CODE&gt; to &lt;CODE&gt;1000&lt;/CODE&gt; in steps of &lt;CODE&gt;100&lt;/CODE&gt; like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;0 | 100 | 200 | 300.......|1000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and then just fill in the data for each &lt;CODE&gt;Server&lt;/CODE&gt;?&lt;BR /&gt;
I mean splunk does it automatically with the &lt;CODE&gt;Y-axis&lt;/CODE&gt; so it's pretty much what splunk does with the &lt;CODE&gt;Y-axis&lt;/CODE&gt;, I just wanna have that behavior also with the &lt;CODE&gt;X-axis&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;If you Need more Information just ask.&lt;/P&gt;

&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2016 15:43:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275745#M83180</guid>
      <dc:creator>undercoverbroth</dc:creator>
      <dc:date>2016-05-31T15:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a X axis and submit different datasets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275746#M83181</link>
      <description>&lt;P&gt;OK, then try this (you will have to add all of your non-relevant fields to the end of the &lt;CODE&gt;fields - host search*&lt;/CODE&gt; command or these will show up as Servers):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary_cpu OR index=summary_User | fields - host search*
| multireport
    [ stats values(*) AS * BY _time index | search index="summary_User" | fields - index | untable _time Servername Users ]
    [ stats values(*) AS * BY _time index | search index="summary_cpu"  | fields - index | untable _time Servername CPU ]
| stats values(*) AS * BY _time Servername
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you have 2 followon searches, each of which will be tacked onto the end of the search above:&lt;/P&gt;

&lt;P&gt;1: This is for the visualization (select &lt;CODE&gt;Line Chart&lt;/CODE&gt; as your visualization type):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart avg(CPU) BY Users Servername
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2: This is for your chart (select &lt;CODE&gt;Statistics Table&lt;/CODE&gt; as your visualization type):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart values(*) AS * BY Servername
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;P.S. The &lt;CODE&gt;stats values(*) AS * BY _time index |&lt;/CODE&gt; in the front of each &lt;CODE&gt;multireport&lt;/CODE&gt; clause, although it does absolutely nothing, &lt;EM&gt;IS&lt;/EM&gt; important and the solution will not work properly without it.&lt;/P&gt;

&lt;P&gt;For anyone interested in faking the raw data for this, you can use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|noop | rename Comment AS "First, mockup sample data"
|stats count AS time
| eval time="1,2,3,4,5,6" | makemv delim="," time | mvexpand time
| eval Servername-CPU=case((time="1"), "Server A::3,Server B::2,Server C::5",
                           (time="2"), "Server A::5,Server B::5,Server C::6",
                           (time="3"), "Server A::7,Server B::6,Server C::8",
                           (time="4"), "Server A::8,Server B::7,Server C::9",
                           (time="5"), "Server A::12,Server B::10,Server C::14",
                           (time="6"), "Server A::15,Server B::12,Server C::18")
| makemv delim="," Servername-CPU | mvexpand Servername-CPU | rex field=Servername-CPU "^(?&amp;lt;Servername&amp;gt;.*?)::(?&amp;lt;CPU&amp;gt;\d+)$" | fields - Servername-CPU
| fields time Servername CPU
| xyseries time Servername CPU | eval index="summary_cpu"
| append [
|noop | rename Comment AS "First, mockup sample data"
|stats count AS time
| eval time="1,2,3,4,5,6" | makemv delim="," time | mvexpand time
| eval Servername-User=case((time="1"), "Server A::200,Server B::143,Server C::253",
                            (time="2"), "Server A::263,Server B::275,Server C::345",
                            (time="3"), "Server A::458,Server B::336,Server C::480",
                            (time="4"), "Server A::490,Server B::425,Server C::556",
                            (time="5"), "Server A::753,Server B::655,Server C::723",
                            (time="6"), "Server A::952,Server B::723,Server C::1073")
| makemv delim="," Servername-User | mvexpand Servername-User | rex field=Servername-User "^(?&amp;lt;Servername&amp;gt;.*?)::(?&amp;lt;User&amp;gt;\d+)$" | fields - Servername-User
| fields time Servername User
| xyseries time Servername User | eval index="summary_User"]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jun 2016 07:45:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-define-a-X-axis-and-submit-different-datasets/m-p/275746#M83181</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-03T07:45:47Z</dc:date>
    </item>
  </channel>
</rss>

