Splunk Search

How do I add extra fields to a "chart count over fieldA by fieldB" search?

rjrcooper
New Member

In the earthquake example at the bottom of the chart help page (http://docs.splunk.com/Documentation/Splunk/6.0.9/SearchReference/Chart ), how would I also show a decription of each of the "mag" values if the description was held in a field/variable named "desc"?

I am doing a chart count over user by EventType (where user is their email address), but want to include more information about the user (name, phone number, etc). In the "earthquake" example at the bottom of the chart page, if I wanted to include a description of each "mag" value, what would my search look like assuming that this description is held in a variable/field called "desc"?

0 Karma
1 Solution

somesoni2
Revered Legend

Try something like this

your base search | eval user=user."#".name."#".phone | chart count over user by EventType | rex field=user "(?<user>.*)#(?<name>.*)#(?<phone>.*)"

View solution in original post

somesoni2
Revered Legend

Try something like this

your base search | eval user=user."#".name."#".phone | chart count over user by EventType | rex field=user "(?<user>.*)#(?<name>.*)#(?<phone>.*)"

rjrcooper
New Member

Thanks - that worked.

Are you aware of any other methods for achieving the same thing? The problem is I can't be sure what characters will be in the other fields I want to include. So it happened that there were '#' in "name" (it's not actually name - I was using that as an example) so I have used ^ instead. It's unlikely that this character will occur but still... it would be nice to find a solution that doesn't depend on concatenating and then separating strings....

Thanks!

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...