Unable to Proceed with the Practice session in Sumologic in Conditional Oprator:
Using the query in step 2 as a starting point, amend the query to scan through Labs/Apache/Access and return the number of redirects. What's the sum of redirects for the last 15 minutes? Round to the nearest thousand.
Hint: This will require adding an additional if expression for redirects:
if(status_code matches "3*", 1, 0) as redirects
AND an additional sum expression in the last line:
sum(redirects) as redirects_cnt
I tried with the below solution, but it failed
| parse "HTTP/1.1\" * " as status_code
| if(status_code matches "4*", 1, 0) as client_err
| if(status_code matches "5*", 1, 0) as server_err
| if(status_code matches "3*", 1, 0) as redirects
| sum(server_err) as server_errors_cnt, sum(client_err) as client_errors_cnt, sum(redirects) as redirects_errors_cnt
Please sign in to leave a comment.