In 4.0 and 4.1, the best way to classify a field, like clientip is through eventtypes. For example, in splunk's own app to monitor the splunk.com website we use eventtypes like:
[clientip-internal]
search = clientip=64.127.105.32/27
[clientip-nonroutable]
search = clientip=10.0.0.0/8 OR clientip=172.16.0.0/12 OR clientip=192.168.0.0/16
[clientip-public]
search = eventtype!=clientip-internal eventtype!=clientip-nonroutable
With these, you can construct a field like clientip_class through the search fragment: ... | eval clientip_class = mvfilter(clientip LIKE "clientip-%") | ...
Now, another alternative is to use scripted lookups, since native lookup tables don't support CIDR netblocks or wildcards in 4.0 and 4.1.
In 4.2, the best practice is to use lookup tables. For example, in transforms.conf add:
[ipdomain]
filename = clientipclass.csv
match_type = CIDR(clientip)
And in clientipclass.csv have:
clientip,class
10.0.0.0/8,internal
172.16.0.0/12,internal
192.168.0.0/16,internal
64.127.105.32/27,corporate
Of course, in this case you'll have to set min_matches and default_value in transforms.conf to fill in the default of external.
... View more