I want to filter the search by matching IP address to subnet masks. I extracted the ip_address field.
I created lookup table file named AP-Subnet.csv
subnets,ap
10.24.0.0/14,YES
163.243.193.0/24,YES
10.120.250.0/24,YES
10.124.248.0/21,YES
Then I created lookup definition AP_subnet_lookups

This is my search
sourcetype="logs" |transaction ip_address |lookup AP_subnet_lookups subnets |table eventcount ip_address hostname
The search result contains other ip addresses that doesn't match the masks.
How should I change my search?