I have a question. I've been trying to figure this out for a while.
I have a search I'm using to calculate the number of times users looked at specific reports. I have the number of all users per location in a lookup file. I then calculate the number of times a file was actually accessed per user and calculate a percentage to get an idea of which files are the most popular.
However, I'm looking to get away from the lookup file as it's not always an accurate count of the active users. I've created a script that will query a database and dump the number of users into a file each day. This file is logged by splunk.
Here's the problem. The logs now generated by the script are under a different sourcetype then the main search.
This was my search using a lookup file. The fields the lookup used were registry and registrarcount:
sourcetype="EPPWEB" source="/opt/log/*/web_server/info.log" OR source="/opt/log/*/*/web_server/info.log" WAT | dedup registrar,description,registry | stats count(registrar) as numviewed,max(registrarcount) as registrarcount by description,registry | eval percent=numviewed/registrarcount*100| fields registry, description, numviewed, registrarcount, percent
This is the search I now use to just get the count of how many users there are and also the name for each user. This is the information this is being called by the script and dumped in a log now. This isn't using a lookup file:
sourcetype=registrarcount | stats max(registrarcount) by registry
I need to somehow combine them. I tried doing "what i thought" was a subsearch but this didn't seem to work. I got the error "subsearches are only valid as arguments to commands:
sourcetype="EPPWEB" source="/opt/log/dotinfo/web_server/info.log" OR source="/opt/log/dotinfo/*/web_server/info.log" WAT | [ search sourcetype="registrarcount" ] | dedup registrar,description,registry | stats count(registrar) as numviewed,max(registrarcount) as registrarcount by description,registry | eval percent=numviewed/registrarcount*100| fields registry, description, numviewed, registrarcount, percent
Anyone have any ideas how to combine these searches? Should I use transaction?
... View more