All Apps and Add-ons

Splunk for Asset Discovery: How to fix search syntax for port signatures panel?

peter_royle
Engager

the port signatures panel of the port overview dashboard is not working
The search string is:

eventtype=port_scan "Linux 2.6.32 - 3.10" | stats dc(dest_ip) as count by port_signature | where match(port_signature, replace(replace(""Linux 2.6.32 - 3.10"", "\s*OR\s*", "|"), "*", ".*")) | sort - count

The error is:

Error in 'where' command: The expression is malformed. Expected LIKE.

I get the problem just can't work out where to put the LIKE

Anyone?

Kind Regards
Peter

1 Solution

pmdba
Builder

The problem is in your second "replace()" call. The "Linux 2.6.32 - 3.10" term should only be contained in a single set of double-quotes, not two sets.

What you have:

eventtype=port_scan "Linux 2.6.32 - 3.10" | stats dc(dest_ip) as count by port_signature | where match(port_signature, 
replace(replace(""Linux 2.6.32 - 3.10"", "\s*OR\s*", "|"), "\*", ".*")) | sort - count

What it should be:

eventtype=port_scan "Linux 2.6.32 - 3.10" | stats dc(dest_ip) as count by port_signature | where match(port_signature, 
replace(replace("Linux 2.6.32 - 3.10", "\s*OR\s*", "|"), "\*", ".*")) | sort - count

View solution in original post

pmdba
Builder

The problem is in your second "replace()" call. The "Linux 2.6.32 - 3.10" term should only be contained in a single set of double-quotes, not two sets.

What you have:

eventtype=port_scan "Linux 2.6.32 - 3.10" | stats dc(dest_ip) as count by port_signature | where match(port_signature, 
replace(replace(""Linux 2.6.32 - 3.10"", "\s*OR\s*", "|"), "\*", ".*")) | sort - count

What it should be:

eventtype=port_scan "Linux 2.6.32 - 3.10" | stats dc(dest_ip) as count by port_signature | where match(port_signature, 
replace(replace("Linux 2.6.32 - 3.10", "\s*OR\s*", "|"), "\*", ".*")) | sort - count

peter_royle
Engager

Thanks that works

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...