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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

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