I have a dashboard that is displaying 3 charts and a table. In the 3 charts the legend mostly consists the source path of the logs files that are being displayed in the charts. The source path is pretty long and I'd really like to just have the source path displayed as one word describing each source.
I really only want it for these charts on the dashboard and not all throughout splunk. Anyone have an idea of what the best way to do this? Do I have to put something in the actual search to tell splunk to relabel the source?
I want it displayed in chart as just Sandstorm and not /opt/log/sandstorm/home/dataserver.log
In the search you're using to generate each graph, sometime before your stats/chart/timechart command, create a new field that holds only the last portion of the source field:
... | rex field=source "/(?<source_short>[^/]+)$"
Then split by that field instead of by source.
Well I tried doing this but I haven't seen the result I need. My search I was using was: sourcetype="cronBalanceEmail" NOT host=".bmp2." earliest=-1d@d latest=-0d@d sent ([BalanceEmail] OR [null]) | rex field=raw "\w+] ?(?
The location of the sourcetype for all of these logs is in the same location but each one is named differently. such as /opt/log/sandstorm/logs/sandstorm.log, /opt/log/snowstorm/logs/snowstorm.log, etc. I just want the main words like Sandstorm or Snowstorm to show up for source. I'll keep trying but any other comments are welcome!
If i add this, the results in the table are still the same: sourcetype="cronBalanceEmail" NOT host=".bmp2." earliest=-1d@d latest=-0d@d sent ([BalanceEmail] OR [null]) | rex field=raw "\w+] ?(?
i tried renaming source_short to other things, didnt' work. I tried making the regex | rex field=source "/opt/log/(?
The field listed was the last portion of the log path. If the log path is /opt/log/dotinfo/eppcron/eppcronbalancememail.log, it listed as the sourceshort as only eppcron_balanceemail.log. I should list dotinfo.