Hi , I have the following search query that lookups definition file TeamsLookupDef which has 200 mappings between apifamily and domain, running the query is always going to waiting for queued job to start, any ideas how can this query be improved for performance ?
Query -
| savedsearch AR_BaseQuery filter=*
| eventstats count as tc
| stats distinct_count(URI) as #APIs, first(tc) as tc by APIFamily
| lookup TeamsLookupDef APIFamily as APIFamily output Domain
| stats sum(#APIs) as Apis, first(tc) as tc by Domain
TeamsLookupDef definition file for mapping betwene apifamily and domain fields.
-APIFamily- -Domain-
/url1/v1 Unknown
/url2/v1 dp-iis1
/url3/v1 dp-iis2
... ...
200 mapping entries for definition
| savedsearch AR_BaseQuery filter=*
This is the cause of poor performance.
please provide sample logs and explain fields.
Following is description of saved search AR_BaseQuery-
search environment=test
index=iis* NOT "GET / - 80" NOT "GET / - 443" NOT "/ping*" NOT "swagger" $filter$
|eval URI=lower(cs_uri_stem)
|rex field=URI "(?APIFamily[/\w.]+/v\d+)/"
cs uri stem is just different uri end points
api family is categorizing uri's by api family
domain is categorizing api family by domain mapping
index=iis* cs_uri_stem=* [|inputlookup TeamsLookupDef
|fields APIFamily|return 200 $APIFamily]
|eval URI=lower(cs_uri_stem)
|rex field=URI "(?<APIFamily>[/\w.]+/v\d+)/"
| eventstats count as tc
| stats distinct_count(URI) as #APIs, first(tc) as tc by APIFamily
| lookup TeamsLookupDef APIFamily as APIFamily output Domain
| stats sum(#APIs) as Apis, first(tc) as tc by Domain
maybe a little faster.