Like this (upper-casing of AND
is VERY important):
index="YouShouldAlwaysSpecifyAnIndex" AND sourcetype="AndSourcetypeToo" AND ProxyName="PLB" AND ("/policies" OR "/bills")
| eval TYPE = if(searchmatch("/policies"), "policies", "bills")
| stats COUNT BY TYPE ProxyName
Or better yet, like this:
index="YouShouldAlwaysSpecifyAnIndex" AND sourcetype="AndSourcetypeToo" AND ProxyName="PLB" AND ("/policies" OR "/bills")
| eval TYPE = if(searchmatch("/policies"), "policies", "bills")
| chart COUNT BY TYPE ProxyName
Or even better, like this:
index="YouShouldAlwaysSpecifyAnIndex" AND sourcetype="AndSourcetypeToo" AND ProxyName="PLB" AND ("/policies" OR "/bills")
| stats count AS TOTAL count(eval(searchmatch("/policies"))) AS policies count(eval(searchmatch("/bills"))) AS bills BY ProxyName
Could you provide event samples that contain both types? Have you considered extracting the field "type". Please provide some more data so we can see what you're working with.