<?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: Why is the chart command not working properly? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-chart-command-not-working-properly/m-p/397701#M26024</link>
    <description>&lt;P&gt;Thank you super very much.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jun 2018 14:30:47 GMT</pubDate>
    <dc:creator>zacksoft</dc:creator>
    <dc:date>2018-06-20T14:30:47Z</dc:date>
    <item>
      <title>Why is the chart command not working properly?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-chart-command-not-working-properly/m-p/397699#M26022</link>
      <description>&lt;P&gt;sample event&lt;/P&gt;

&lt;H1&gt;10.138.258.78 522x533587x10 JOHNNY [20/Jun/2018:08:42:23 -0400] "GET /rest/redbopper/1.0/xboard/work/allData.json?rapidViewId=9124&amp;amp;selectedProjectKey=BMRIEMARED&amp;amp;etag=9128%2C1529498111000%2C%5B%5D%2C%5B%5D%2C560&amp;amp;_=1529498542404 HTTP/1.1" 200 181 &lt;STRONG&gt;748&lt;/STRONG&gt; "&lt;A href="https://phutan.mayhem.com/secure/ActiveBoard.jspa?superView=9024"&gt;https://phutan.mayhem.com/secure/ActiveBoard.jspa?superView=9024&lt;/A&gt;" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36" "ihb3tl"&lt;/H1&gt;

&lt;P&gt;The number in bold indicates the response time and JOHNNY is the user. I wanted to get a chart drawn of the response time of all the transactions of the user. Here is my query. But I am not able to use the chart command properly.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="Zaccess" host=A OR host=B NOT host=C AND JOHNNY
| eval headers=split(_raw," ")
 | eval username=mvindex(headers,2) 
| eval method=mvindex(headers,5)
 | eval Request=mvindex(headers,6) 
| eval Status=mvindex(headers,8) 
| eval req_time=mvindex(headers,10) 
| eval uri=mvindex(headers,11)
 | eval Method=replace(method,"\"","") 
| eval uri=replace(uri,"\"","") 
| eval Run_Time = req_time*0.001
 | rex field=_raw "\"(?[^\s]+)\"$"
 | eval c_time=strftime(_time,"%m/%d/%y %H:%M:%S") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, is it possible to input the username as a parameter as a dashboard input instead of hardcoding it in the query?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 12:58:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-chart-command-not-working-properly/m-p/397699#M26022</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2018-06-20T12:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the chart command not working properly?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-chart-command-not-working-properly/m-p/397700#M26023</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/65483"&gt;@zacksoft&lt;/a&gt;,&lt;/P&gt;

&lt;P&gt;Does this work for you ? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count|eval _raw="10.138.258.78 522x533587x10 JOHNNY [20/Jun/2018:08:42:23 -0400] \"GET /rest/redbopper/1.0/xboard/work/allData.json?rapidViewId=9124&amp;amp;selectedProjectKey=BMRIEMAREDηg=9128%2C1529498111000%2C%5B%5D%2C%5B%5D%2C560&amp;amp;_=1529498542404 HTTP/1.1\" 200 181 748 \"https://phutan.mayhem.com/secure/ActiveBoard.jspa?superView=9024\" \"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36\" \"ihb3tl\""
|rex "^(?:[^ \n]* ){2}(?P&amp;lt;user&amp;gt;\w+)"|rex "^(?:[^ \n]* ){10}(?P&amp;lt;resp_time&amp;gt;\d+)"|rex "^[^ \n]* (?P&amp;lt;txn_id&amp;gt;[^ ]+)"
|fields user,resp_time,txn_id|stats max(resp_time) by txn_id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Only last 2 lines are processing data.&lt;/P&gt;

&lt;P&gt;Yes you could use parameter for user name in dashboard using &lt;CODE&gt;tokens&lt;/CODE&gt;. Refer to &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/7.0.3/Viz/tokens#Define_tokens_for_form_inputs" target="_blank"&gt;Define_tokens_for_form_inputs&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:06:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-chart-command-not-working-properly/m-p/397700#M26023</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-09-29T20:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the chart command not working properly?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-chart-command-not-working-properly/m-p/397701#M26024</link>
      <description>&lt;P&gt;Thank you super very much.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 14:30:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-the-chart-command-not-working-properly/m-p/397701#M26024</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2018-06-20T14:30:47Z</dc:date>
    </item>
  </channel>
</rss>

