<?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 can I generate http status code vs all traffic on a line graph in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-generate-http-status-code-vs-all-traffic-on-a-line/m-p/624767#M217188</link>
    <description>&lt;P&gt;My bad, i miss typed the actual command. It was supposed to be as below:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=infra_device_sec sourcetype=device:cloudmonitor:json "message.reqPath"="/test/alpha/beta/delta" |&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;eval x=if('message.status'=503,"ServerDenied","All-Traffic")&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;| timechart span=20m count by x useother=f&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tried a query you suggested above, and I am able to see all status code on a line graph, but can we also include all traffic vs status codes?&lt;/P&gt;</description>
    <pubDate>Mon, 19 Dec 2022 21:28:55 GMT</pubDate>
    <dc:creator>zack</dc:creator>
    <dc:date>2022-12-19T21:28:55Z</dc:date>
    <item>
      <title>How can I generate http status code vs all traffic on a line graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-generate-http-status-code-vs-all-traffic-on-a-line/m-p/624762#M217186</link>
      <description>&lt;P&gt;Hi everyone, I am comparatively new to Splunk and trying to create visualization of each http status code vs all traffic line graph that is traversing though the device. I am able to extract all status code due to a specific path and was able to each of the status code for a specified time as below:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;index=infra_device_sec sourcetype=device:cloudmonitor:json "message.reqPath"="/test/alpha/beta/delta" | stats count by message.status&lt;/P&gt;&lt;P&gt;&lt;FONT face="splunk_data_sans, Arial, sans-serif" color="#363c44"&gt;message.status&lt;/FONT&gt;&lt;SPAN&gt;&lt;A href="https://tir-splunkse.ms.com/en-US/app/search/search?earliest=1670821200&amp;amp;latest=1671253200&amp;amp;q=search%20index%3Dinfra_waf_akamai%20sourcetype%3Dakamai%3Acloudmonitor%3Ajson%20%22message.reqPath%22%3D%22%2Ff16%2Fcommon%2Fwebapp%2Ffx%2Fsecured%2Fsvc%2Fv1%2Ftrades%2Fdelta%22%20%7C%20stats%20count%20by%20message.status&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;display.page.search.tab=statistics&amp;amp;display.general.type=statistics&amp;amp;sid=1671480194.148370_8D205825-2800-459D-9D43-E5036F6FCBD1#" target="_blank" rel="noopener"&gt;count&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;3129&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;302&lt;/TD&gt;&lt;TD&gt;56321&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;403&lt;/TD&gt;&lt;TD&gt;10439&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;408&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a graph for each status code vs all traffic as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;index=infra_device_sec sourcetype=device:cloudmonitor:json "message.reqPath"="/test/alpha/beta/delta" | stats count by message.status | &lt;STRONG&gt;eval x=if('message.status'=503,"ServerDenied","All-Traffic")&lt;/STRONG&gt; | timechart span=20m count by x useother=f&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the output is showing only all traffic on a line graph. Could someone please guide two things:&lt;/P&gt;&lt;P&gt;1- How can create a line graph on each status code vs all traffic&lt;/P&gt;&lt;P&gt;2- How can I create a line graph which include all above status code vs all traffic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if any clarification is needed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 20:47:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-generate-http-status-code-vs-all-traffic-on-a-line/m-p/624762#M217186</guid>
      <dc:creator>zack</dc:creator>
      <dc:date>2022-12-19T20:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can I generate http status code vs all traffic on a line graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-generate-http-status-code-vs-all-traffic-on-a-line/m-p/624766#M217187</link>
      <description>&lt;P&gt;I'm not sure what you're trying to achieve but I suppose that you want to have counts of various status codes during specific time periods (like every 10 minutes).&lt;/P&gt;&lt;P&gt;You have to remember that when splunk processes your search, after a pipe it sees only the results from the immediately preceeding command. So if you aggregate your events with "stats count by status" you get just a number of total count for each status and that's it. Splunk no longer knows at this point what events this result is composed of and it can't "split" them to calculate stats differently.&lt;/P&gt;&lt;P&gt;So if you want to have your timechart split by status, you have to - surprise, surprise &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; - do&lt;/P&gt;&lt;PRE&gt;index=something sourcetype=whatever and so on&lt;BR /&gt;| timechart count by message.status&lt;/PRE&gt;&lt;P&gt;You don't do any intermediate stats.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 21:12:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-generate-http-status-code-vs-all-traffic-on-a-line/m-p/624766#M217187</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-12-19T21:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I generate http status code vs all traffic on a line graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-generate-http-status-code-vs-all-traffic-on-a-line/m-p/624767#M217188</link>
      <description>&lt;P&gt;My bad, i miss typed the actual command. It was supposed to be as below:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=infra_device_sec sourcetype=device:cloudmonitor:json "message.reqPath"="/test/alpha/beta/delta" |&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;eval x=if('message.status'=503,"ServerDenied","All-Traffic")&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;| timechart span=20m count by x useother=f&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tried a query you suggested above, and I am able to see all status code on a line graph, but can we also include all traffic vs status codes?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 21:28:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-generate-http-status-code-vs-all-traffic-on-a-line/m-p/624767#M217188</guid>
      <dc:creator>zack</dc:creator>
      <dc:date>2022-12-19T21:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I generate http status code vs all traffic on a line graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-generate-http-status-code-vs-all-traffic-on-a-line/m-p/624788#M217196</link>
      <description>&lt;P&gt;I think your question is about visualization when you say "all traffic vs status codes", meaning that you want to add a visualization to represent total on the same graph in addition each line by x.&lt;/P&gt;&lt;P&gt;If you don't need the value of total, you can simply change visualization from line draw to area or block, then select "Stacked" in stack mode. &amp;nbsp;If you want the value of total, you can&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Addcoltotals" target="_blank" rel="noopener"&gt;addcoltotals&lt;/A&gt;&amp;nbsp;after timechart.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=infra_device_sec sourcetype=device:cloudmonitor:json "message.reqPath"="/test/alpha/beta/delta"
| eval x=if('message.status'=503,"ServerDenied","All-Traffic")
| timechart span=20m count by x useother=f
| addtotals&lt;/LI-CODE&gt;&lt;P&gt;The line "Total" represents all traffic.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 05:00:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-generate-http-status-code-vs-all-traffic-on-a-line/m-p/624788#M217196</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-12-20T05:00:41Z</dc:date>
    </item>
  </channel>
</rss>

