Splunk Search

extracting response status time

mammefen
New Member

How can i extract the the http_response_time so that i can get the max(HTTP_STATUS_RESPONSE), MIN(HTTP_STATUS_RESPONSE) and median(HTTP_STATUS_RESPONSE). from the following events

6/28/19 9:05:26.760 AM INFO 2019-06-28 05:05:26,760 ------- [[------_rrfi.zip].throttling-task.01] LoggerMessageProcessor AFTER: IP_address: ....... API_name: ........ server ip :......... trace id: ------location: en_US {http.status=200, Content-Type=application/json;charset=UTF-8}

6/28/19 4:08:52.952 PM INFO 2019-06-28 12:08:52,952 -------[[-------_rrfi.zip].throttling-task.01] LoggerMessageProcessor  BEFORE: IP_address: null API_name:-------server ip: -----trace id: ------ location: en_US
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Assuming trace id is unique for a transaction and is extracted as trace_id, try this query:

index = foo | stats earliest(_time) as start, latest(_time) as end, values(http.status) as http_status, value(server_ip) as server_ip by trace_id | eval http_response_time = tostring(end - start, "duration")

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Assuming trace id is unique for a transaction and is extracted as trace_id, try this query:

index = foo | stats earliest(_time) as start, latest(_time) as end, values(http.status) as http_status, value(server_ip) as server_ip by trace_id | eval http_response_time = tostring(end - start, "duration")

---
If this reply helps you, Karma would be appreciated.
0 Karma

mammefen
New Member

Thank you for your best answer . so, i want to create this http_status_time as a field and use it for another search like to get the MIN(http_response_time ) , MAX(http_response_time ) and median(http_response_time ) for each api and for each month?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Where is the http_response_time field in those events?
Do you want to do the extraction at index time or search time?

---
If this reply helps you, Karma would be appreciated.
0 Karma

mammefen
New Member

i want to extract the duration of the the response from the beginning to the end event log as "HTTP_STATUS_RESPONSE" so, i did not extract the http_status_response yet .but i have to substract 9:05:26-4:08:52, to get the duration.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...