Splunk Search

How to revise my search in order to convert my cluster map into a choropleth map?

dbcase
Motivator

Hi,

I have a query that supplies IP address and a status code and I have created a cluster map from the results

host="*beta*" source="*access_log*" index=main |rex "(?<src>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"|rex "HTTP.\d.\d.\s+(?<status>\d+)"| iplocation src  |geostats count by status

I'd like to convert this to a choropleth map but so far no luck. As this is my first time trying this I'm kinda stuck.

Tags (2)
0 Karma
1 Solution

sundareshr
Legend

I think, for choropleth maps, you will need geo_* kmz files. Check your lookup definition, there should be a few. Pick the one that's appropriate for your data (countries, states etc). Then your query would look something like this (you'll have to tweak it)

host="*beta*" source="*access_log*" index=main |rex "(?<src>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" | rex "HTTP.\d.\d.\s+(?<status>\d+)" | iplocation src  | lookup geo_countries latitude AS lat, longitude AS long | stats count BY featureIdField AS country | geom geo_countries featureIdField="country"

View solution in original post

0 Karma

sundareshr
Legend

I think, for choropleth maps, you will need geo_* kmz files. Check your lookup definition, there should be a few. Pick the one that's appropriate for your data (countries, states etc). Then your query would look something like this (you'll have to tweak it)

host="*beta*" source="*access_log*" index=main |rex "(?<src>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" | rex "HTTP.\d.\d.\s+(?<status>\d+)" | iplocation src  | lookup geo_countries latitude AS lat, longitude AS long | stats count BY featureIdField AS country | geom geo_countries featureIdField="country"
0 Karma

dbcase
Motivator

Hi Sundareshr,

I think with your help I got it to work. Had to make a few changes on your query. It ended up looking like this

host="*beta*" source="*access_log*" index=main |rex "(?<src>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" | rex "HTTP.\d.\d.\s+(?<status>\d+)" | iplocation src  | lookup geo_countries latitude AS lat, longitude AS lon |stats count BY featureId|geom geo_countries featureId="country"
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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