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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...