<?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: Create a view in dashboard like below in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-view-in-dashboard-like-below/m-p/704930#M57750</link>
    <description>&lt;P&gt;Looks like a normal line chart. What is so special about this one?&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2024 10:05:54 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-11-21T10:05:54Z</dc:date>
    <item>
      <title>Create a view in dashboard like below</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-view-in-dashboard-like-below/m-p/704926#M57749</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anna_1-1732181092457.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/33556i74A7B84E13F93ED9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anna_1-1732181092457.png" alt="anna_1-1732181092457.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;want to create view like above under dashboard&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 09:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-view-in-dashboard-like-below/m-p/704926#M57749</guid>
      <dc:creator>anna</dc:creator>
      <dc:date>2024-11-21T09:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create a view in dashboard like below</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-view-in-dashboard-like-below/m-p/704930#M57750</link>
      <description>&lt;P&gt;Looks like a normal line chart. What is so special about this one?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 10:05:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-view-in-dashboard-like-below/m-p/704930#M57750</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-11-21T10:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create a view in dashboard like below</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-view-in-dashboard-like-below/m-p/704952#M57753</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248239"&gt;@anna&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;said, it seems to be a normal line chart.&lt;/P&gt;&lt;P&gt;So you have to create your search, visualize it as chart (choosing the Line Chart diagram) and then save it in a new dashboard.&lt;/P&gt;&lt;P&gt;What's your issue?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 14:01:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-view-in-dashboard-like-below/m-p/704952#M57753</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-11-21T14:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create a view in dashboard like below</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-view-in-dashboard-like-below/m-p/705124#M57762</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248239"&gt;@anna&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;The chart, timechart, xyseries, and tstats commands all produce output suitable for a run chart, depending on our source events.&lt;/P&gt;&lt;P&gt;The chart and timechart commands bin _time into spans automatically or using the span size we specify:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;index=web sourcetype=access_common
| chart limit=0 usenull=false count over _time span=1h by status&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;index=web sourcetype=access_common
| timechart limit=0 span=1h usenull=false count by status&lt;/LI-CODE&gt;&lt;P&gt;Note that the timechart command pads the results with empty bins spanning our search time range. To remove extraneous bins, set the fixedrange argument to false:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| timechart fixedrange=false limit=0 span=1h usenull=false count by status&lt;/LI-CODE&gt;&lt;P&gt;The xyseries command first requires binning _time using the bin command and then aggregating status values using the stats command. Like the chart and timechart commands, the bin command bins the target field into spans automatically or using the span size we specify; however, the stats command does not generate empty bins. We use the makecontinuous command after the xyseries command to add missing _time bins:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;index=web sourcetype=access_common
| bin _time span=1h
| stats count by _time status
| xyseries _time status count
| makecontinuous _time
| fillnull value=0&lt;/LI-CODE&gt;&lt;P&gt;The tstats command is similar to the stats command but works with indexed fields or terms and data models. We can pipe the output through either the timechart command or the xyseries command to group events by status over _time.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| tstats prestats=true count from datamodel=Web.Web by _time Web.status
| rename Web.* as *
| timechart limit=0 span=1h usenull=false count by status&lt;/LI-CODE&gt;&lt;P&gt;Like the chart and timechart commands, the tstats command normally bins _time into spans automatically or using the span size we specify; however, when using a datamodel without the prestats argument, specify a span:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| tstats count from datamodel=Web.Web by _time span=1h Web.status
| rename Web.* as *
| xyseries _time status count
| makecontinuous _time
| fillnull value=0&lt;/LI-CODE&gt;&lt;P&gt;If the status field is indexed, the tstats command can reference it directly:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| tstats prestats=true count where index=web sourcetype=iis by _time sc_status
| rename sc_status as status
| timechart limit=0 span=1h usenull=false count by status&lt;/LI-CODE&gt;&lt;P&gt;If the status field and value appear in _raw as a key-value pair not separated by a major breaker, we can use the PREFIX() directive to access the status value as if it were indexed.&lt;/P&gt;&lt;P&gt;Given events like the following:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Nov 23 12:00:00 my_server my_app[1234]: c_ip=192.0.2.1 request="GET /favicon.ico" status=500 bytes=1024&lt;/LI-CODE&gt;&lt;P&gt;we can execute:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| tstats prestats=true count where index=web sourcetype=access_common by _time PREFIX(status=)
| rename status= as status
| timechart limit=0 span=1h usenull=false count by status&lt;/LI-CODE&gt;&lt;P&gt;The prestats argument in these examples instructs the tstats command to produces results suitable for the chart, stats, and timechart commands. The prestats argument is not required, but it allows subsequent commands to work as they would following other generating commands. The most common generating command is the search command, which we use implicitly in every search that doesn't begin with a pipe.&lt;/P&gt;&lt;P&gt;We can find more information on breakers, the tstats command, and the PREFIX() directive in the Splunk documentation.&lt;/P&gt;&lt;P&gt;Irrespective of the method used to count events, we can add a total field by piping the results through the addtotals command:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;index=web sourcetype=access_common
| timechart limit=0 span=1h usenull=false count by status
| addtotals fieldname="total requests"&lt;/LI-CODE&gt;&lt;P&gt;We can filter status values while retaining a total request count in two (or more!) ways: 1) group status values before aggregating or 2) filter status values after aggregating.&lt;/P&gt;&lt;P&gt;We can use the eval and appendpipe commands to group status values and calculate total requests over _time:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;index=web sourcetype=access_common
| eval status=if(status&amp;gt;=400, status, "other")
| bin _time span=1m
| stats count by _time status
| appendpipe
[| stats sum(count) as count by _time
| eval status="total requests" ]
| where status!="other"
| xyseries _time status count
| fillnull value=0&lt;/LI-CODE&gt;&lt;P&gt;We can use the untable command to filter status values after aggregating:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;index=web sourcetype=access_common
| timechart limit=0 span=1h usenull=false count by status
| addtotals fieldname="total requests"
| untable _time status count
| where status&amp;gt;=400 OR status=="total requests"
| xyseries _time status count
| makecontinuous _time
| fillnull value=0&lt;/LI-CODE&gt;&lt;P&gt;The makecontinuous command isn't required following the timechart command, but it's included here as a failsafe.&lt;/P&gt;&lt;P&gt;As &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp; and &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;noted, we use the Line Chart visualization to produce a run chart and then save the visualization to a new or existing dashboard. We can also create the Line Chart directly using the classic and Dashboard Studio editors.&lt;/P&gt;&lt;P&gt;All of the examples used above produce a chart similar to the following (shown in log scale):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tscroggins_0-1732393520921.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/33572i6CC4E2C4AC5140FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tscroggins_0-1732393520921.png" alt="tscroggins_0-1732393520921.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the Simple XML Line Chart visualization, the points on the lines and the legend entries are drill-down targets. We can access the status value using the click.name2 token and the context-sensitive time range using the earliest and latest tokens:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tscroggins_1-1732393619245.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/33573i48A09FF660296CB5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tscroggins_1-1732393619245.png" alt="tscroggins_1-1732393619245.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1" theme="light"&amp;gt;
  &amp;lt;label&amp;gt;Drilldown Example&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="time" token="time_tok" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Time&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Volumes&amp;lt;/title&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=web sourcetype=access_common
| timechart limit=0 span=1h usenull=false count by status
| addtotals fieldname="total requests"
| untable _time status count
| where status&amp;gt;=400 OR status=="total requests"
| xyseries _time status count
| makecontinuous _time 
| fillnull value=0&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$time_tok.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$time_tok.latest$&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.axisTitleX.text"&amp;gt;t&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY.text"&amp;gt;#&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.scale"&amp;gt;log&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;line&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;drilldown&amp;gt;
          &amp;lt;link target="_blank"&amp;gt;search?q=index%3Dweb%20sourcetype%3Daccess_common%20status%3D%22$click.name2$%22&amp;amp;amp;earliest=$earliest$&amp;amp;amp;latest=$latest$&amp;lt;/link&amp;gt;
        &amp;lt;/drilldown&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Clicking the "total requests" series will generate the following search, which will return no results:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;index=web sourcetype=access_common status="total requests"&lt;/LI-CODE&gt;&lt;P&gt;We can handle this case using condition elements within the drilldown element:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;drilldown&amp;gt;
  &amp;lt;condition match="$click.name2$ == &amp;amp;quot;total requests&amp;amp;quot;"&amp;gt;
    &amp;lt;link target="_blank"&amp;gt;search?q=index%3Dweb%20sourcetype%3Daccess_common%20status%3D*&amp;amp;amp;earliest=$earliest$&amp;amp;amp;latest=$latest$&amp;lt;/link&amp;gt;
  &amp;lt;/condition&amp;gt;
  &amp;lt;condition match="$click.name2$ != &amp;amp;quot;total requests&amp;amp;quot;"&amp;gt;
    &amp;lt;link target="_blank"&amp;gt;search?q=index%3Dweb%20sourcetype%3Daccess_common%20status%3D%22$click.name2$%22&amp;amp;amp;earliest=$earliest$&amp;amp;amp;latest=$latest$&amp;lt;/link&amp;gt;
  &amp;lt;/condition&amp;gt;
&amp;lt;/drilldown&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Clicking the "total requests" series will now generate the following search:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;index=web sourcetype=access_common status=*&lt;/LI-CODE&gt;&lt;P&gt;Note that using a custom link target allows us to use any of the example searches shown above assuming the underlying events share the same index and source type. Data models, tags, default search indexes, and other configuration techniques can help standardize or simplify our approach to searching data.&lt;/P&gt;&lt;P&gt;Dashboard Studio (not shown) provides similar functionality; however, conditional drilldowns to custom URLs are not supported.&lt;/P&gt;&lt;P&gt;(Thank you for coming to my TED Talk. Disclaimer: Not a TED Talk. I hope this was helpful! I write these responses as an exercise for myself as well.)&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2024 20:29:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-a-view-in-dashboard-like-below/m-p/705124#M57762</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2024-11-23T20:29:09Z</dc:date>
    </item>
  </channel>
</rss>

