Deployment Architecture

How to Transpose Correct Query

strawberry28
Explorer

OLD Query:

source="http:Emerson_P1CDN" AND status_code=200 AND path=*/catalog* AND path!=*thumb* AND path!=*CartRefreshStatusJSON* AND path!=*PriceAjaxView* | bucket span=1m _time | stats count by client_isp,_time | where count >= 600 | convert timeformat="%m/%d/%Y %H:%M:%S" ctime(_time) | sort - count | transpose header_field=_time



When I set this one as an alert, it considers the client_isp and _time as part of the query so even there where no result it is sending a blank alert only the client_isp and time on the first column.

New Query:

source="http:Emerson_P1CDN" AND status_code=200 AND path=*/catalog* AND path!=*thumb* AND path!=*CartRefreshStatusJSON* AND path!=*PriceAjaxView* | bucket span=1m _time | stats count by client_isp,_time | transpose header_field=_time | sort - count | where count >= 600 | convert timeformat="%m/%d/%Y %H:%M:%S" ctime(_time)



While on this one, there were no result at all.

What maybe wrong on this query?

Labels (2)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

The transpose command has an option to deal with this situation.

You could try something like this

source="http:Emerson_P1CDN" AND status_code=200 AND path=*/catalog* AND path!=*thumb* AND path!=*CartRefreshStatusJSON* AND path!=*PriceAjaxView* 
| bucket span=1m _time 
| stats count by client_isp,_time 
| where count >= 600 
| convert timeformat="%m/%d/%Y %H:%M:%S" ctime(_time) 
| sort - count 
| transpose header_field=_time include_empty=f

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The transpose command has an option to deal with this situation.

You could try something like this

source="http:Emerson_P1CDN" AND status_code=200 AND path=*/catalog* AND path!=*thumb* AND path!=*CartRefreshStatusJSON* AND path!=*PriceAjaxView* 
| bucket span=1m _time 
| stats count by client_isp,_time 
| where count >= 600 
| convert timeformat="%m/%d/%Y %H:%M:%S" ctime(_time) 
| sort - count 
| transpose header_field=_time include_empty=f
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...