|
Fellow Splunkers I am building a query where I want to report on location based on source IP address. For example within our internal network the subnet 10.50.6.0/24 corresponds to Sydney, whereas 10.50.7.0/24 corresponds to Melbourne. Thus far I have been able to prove my approach using the cidrmatch function as follows:
Using a case statement doesn't scale when I have hundreds subnets spread across Australia and New Zealand. I was thinking of having a lookup table of the following format:
My problem is that I have not been able to find a way to perform the appropriate lookup. I have the following questions:
Many thanks |
|
As a matter of personal preference, I don't like using event types the way Stephen suggests, especially if there are lots of subnets. Try this...
|
|
As gkanapathy said, this is not possible with CSV lookup tables, but is feasible with external lookups. That said, I think that eventtypes are probably the right knowledge primitive to use with version 4.1 (and 4.2, when it comes out) to solve this problem. For example, in our internal web analytics app, we use eventtypes to "classify" events as being from bots, browsers, internal IPs and in turn pageviews are driven by eventtypes. You can configure
To retrieve, you can search for If you just want to report on these locations, you can add to your search:
Probably the searches for the eventtypes should be e.g.,
(23 Aug '10, 16:30)
gkanapathy ♦
|
|
I realize that my answer may come a bit late, but you could do it through lookups. Perhaps these options were not available at the time of your posting. Create a CSV lookup table with your subnets (in my example I've used a different type of classification for identifying potentially bad site users). We'll call this file
in transforms.conf
in props.conf
This lets you run searches like;
with results like;
Hope this helps, Kristian |
|
No. CSV lookup tables in the current version (4.1.4) must have an exact string match (optionally case-insensitive) to the field. But you could do this using a scripted lookup instead that executed the logic above. You can take a look at |
