Splunk Search

How can I normalize timechart with field values having wide variation

smiththebest
New Member

Have a log file that has http response codes in a particular field. I am doing timechart on it but as the 200 responses are in millions and 4xx and 5xx are in thousands, any deviation of 4xx/5xx is not easily visible. I have to create charts for individual response code to see it. How can I put all response codes in the same timechart and normalize so that any deviations in any response code easily visible?

index=xyz sourcetype=*log | timechart span=5m count by http_rc | ....

Tags (1)
0 Karma
1 Solution

adonio
Ultra Champion

many ways to go about it,

you can use the log button and not the linear button
you can use a single value visualization with trellis
you can present the percent of events from the count
and other ways

try this query anywhere and work with different options:

  | gentimes start=-2 increment=5m
    | eval _time = starttime
    | eval http_rc = "200,404,500"
    | makemv delim="," http_rc
    | mvexpand http_rc
    | eval count_of_code = case(http_rc=="200",random()%200000 + 1000,http_rc=="404",random()%20,http_rc=="500",random()%30)
    | timechart span=10m sum(count_of_code) as total_count by http_rc

some screen shots for reference:
alt text

alt text

View solution in original post

adonio
Ultra Champion

many ways to go about it,

you can use the log button and not the linear button
you can use a single value visualization with trellis
you can present the percent of events from the count
and other ways

try this query anywhere and work with different options:

  | gentimes start=-2 increment=5m
    | eval _time = starttime
    | eval http_rc = "200,404,500"
    | makemv delim="," http_rc
    | mvexpand http_rc
    | eval count_of_code = case(http_rc=="200",random()%200000 + 1000,http_rc=="404",random()%20,http_rc=="500",random()%30)
    | timechart span=10m sum(count_of_code) as total_count by http_rc

some screen shots for reference:
alt text

alt text

smiththebest
New Member

Thank you so much, that is what I have been looking for and did not find in answers or was not able to locate!

0 Karma
Get Updates on the Splunk Community!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...