<?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 Why is stats avg(response_time) not working after extracting response_time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-stats-avg-response-time-not-working-after-extracting/m-p/636403#M221020</link>
    <description>&lt;P&gt;I am a beginner. Why is stats avg(response_time) not working after extracting response_time?&lt;/P&gt;
&lt;P&gt;index="testing1" source="web_access_log_project2.txt" | erex response_time examples="7ms, 0ms, 17ms, 67ms, 77ms, 39ms " | stats count, avg(response_time)&lt;/P&gt;
&lt;P&gt;Below is the sample event:&lt;/P&gt;
&lt;P&gt;127.0.0.1 - - [17/Mar/2023:17:59:13.798 -0400] "HEAD /favicon.ico HTTP/1.1" 303 124 "" "Splunk/9.0.4 (Windows Server 10 Professional with Media Center Edition; arch=x64)" - 6414e2b1cc1a8e6558ec8 7ms&lt;BR /&gt;127.0.0.1 - - [17/Mar/2023:16:02:45.754 -0400] "HEAD /favicon.ico HTTP/1.1" 303 124 "" "Splunk/9.0.4 (Windows Server 10 Professional with Media Center Edition; arch=x64)" - 6414c765c11e7271cf148 0ms&lt;BR /&gt;127.0.0.1 - admin [09/Mar/2023:17:52:41.509 -0500] "GET /en-US/config?autoload=1 HTTP/1.1" 200 1874 "&lt;A href="http://127.0.0.1:8000/" target="_blank" rel="noopener"&gt;http://127.0.0.1:8000/&lt;/A&gt;" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.63" - 640a6339821e0d9ba9848 49ms&lt;BR /&gt;127.0.0.1 - admin [09/Mar/2023:17:52:41.455 -0500] "GET /en-US/account/logout HTTP/1.1" 404 18942 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.63" - 640a6339741e0d987dc08 14ms&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2023 22:26:41 GMT</pubDate>
    <dc:creator>Tioluwani-Ada</dc:creator>
    <dc:date>2023-03-28T22:26:41Z</dc:date>
    <item>
      <title>Why is stats avg(response_time) not working after extracting response_time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-stats-avg-response-time-not-working-after-extracting/m-p/636403#M221020</link>
      <description>&lt;P&gt;I am a beginner. Why is stats avg(response_time) not working after extracting response_time?&lt;/P&gt;
&lt;P&gt;index="testing1" source="web_access_log_project2.txt" | erex response_time examples="7ms, 0ms, 17ms, 67ms, 77ms, 39ms " | stats count, avg(response_time)&lt;/P&gt;
&lt;P&gt;Below is the sample event:&lt;/P&gt;
&lt;P&gt;127.0.0.1 - - [17/Mar/2023:17:59:13.798 -0400] "HEAD /favicon.ico HTTP/1.1" 303 124 "" "Splunk/9.0.4 (Windows Server 10 Professional with Media Center Edition; arch=x64)" - 6414e2b1cc1a8e6558ec8 7ms&lt;BR /&gt;127.0.0.1 - - [17/Mar/2023:16:02:45.754 -0400] "HEAD /favicon.ico HTTP/1.1" 303 124 "" "Splunk/9.0.4 (Windows Server 10 Professional with Media Center Edition; arch=x64)" - 6414c765c11e7271cf148 0ms&lt;BR /&gt;127.0.0.1 - admin [09/Mar/2023:17:52:41.509 -0500] "GET /en-US/config?autoload=1 HTTP/1.1" 200 1874 "&lt;A href="http://127.0.0.1:8000/" target="_blank" rel="noopener"&gt;http://127.0.0.1:8000/&lt;/A&gt;" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.63" - 640a6339821e0d9ba9848 49ms&lt;BR /&gt;127.0.0.1 - admin [09/Mar/2023:17:52:41.455 -0500] "GET /en-US/account/logout HTTP/1.1" 404 18942 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.63" - 640a6339741e0d987dc08 14ms&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 22:26:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-stats-avg-response-time-not-working-after-extracting/m-p/636403#M221020</guid>
      <dc:creator>Tioluwani-Ada</dc:creator>
      <dc:date>2023-03-28T22:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Average response time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-stats-avg-response-time-not-working-after-extracting/m-p/636409#M221021</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252616"&gt;@Tioluwani-Ada&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The "ms" in the response time field makes it a string so it needs to be stripped to make is a integer that can then have mathematical calculations done on it.&lt;BR /&gt;&lt;BR /&gt;The following should meet your needs...&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="testing1" source="web_access_log_project2.txt"
| rex "(?&amp;lt;response_time&amp;gt;\d+)ms$"  ``` strip out response time in ms ```
| stats count avg(response_time) AS avg_response_time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 21:40:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-stats-avg-response-time-not-working-after-extracting/m-p/636409#M221021</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-03-28T21:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Average response time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-stats-avg-response-time-not-working-after-extracting/m-p/636412#M221023</link>
      <description>&lt;P&gt;Thank you so much Yeahnah. It worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 21:50:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-stats-avg-response-time-not-working-after-extracting/m-p/636412#M221023</guid>
      <dc:creator>Tioluwani-Ada</dc:creator>
      <dc:date>2023-03-28T21:50:05Z</dc:date>
    </item>
  </channel>
</rss>

