Context
I have a bunch of application servers I would like monitor using Splunk. Servers on every environment run the same applications. Looking for a way to tag this information in order to easily disentangle stage servers from prod server in my dashboards, I came across this trick while reading forums.
inputs.conf
of forwarders on production machines
[default]
_meta = env::prod
inputs.conf
of forwarders on stage machines
[default]
_meta = env::stage
With this trick, I end up with a env
field in my parsed data.
index=* | stats count by env
| env | count |
|:------:|:-----:|
| stage |2415686|
| prod |55677 |
Issue
I can't filter on env
index=* logLevel="ERROR" projectName != "null" env="prod" | stats count(_raw) by projectName
Why is that so?
host
- presuming you have a naming convention that indicates different environments, it's great – warren