Splunk Search

How can i display all the values for my Field ?

rakesh_498115
Motivator

Hi..

I have created a Field "Questions" in my Splunk Query.When i am using like this..

*myseach | top Questions *

Its not displaying all the Questions in my event.ie one event has max 100 questions..But all of them were not displayed using the top Command ..

Please help..

Tags (2)
0 Karma

thirumalreddyb
Communicator

| top limit=0 Questions should do your work.

0 Karma

lguinn2
Legend

Okay, since Question is a multi-valued field, we need a way to "break out" all the values for question. The mvexpand command will do that. Also, by default the rex command will only extract the first occurrence of the regular expression unless you specify max_match.

Try this:

mysearch 
| rex field=_raw max_match=150 "<question>(?<question>.*?)\<" 
| mvexpand question
| top question
0 Karma

rakesh_498115
Motivator

not exactly this i need..actually in my event i had this abc....etc tag more then 100 times for each event.
When i created the rex expression like this..

mysearch | rex field=_raw "(?[^<]*)<" | top Question

i dnt think all the values are displayed for Question Field..even i use the limit followed by top command..

is there any option like MAX_LENGTH with top to display all the values of Question Tag..

0 Karma

lguinn2
Legend

When you say "one event has max 100 questions," do you mean that each event can have more than one question? Is Question a multi-valued field?

Assuming that Question is not a multi-valued field, try

myseach | stats count by Questions | sort -count

This will give you a list of all Questions, whether there are 50 or 500...

You might want to take a look at some other possible stats functions, such as distinct_count, here

rakesh_498115
Motivator

question is multivalued field only..

0 Karma

sdaniels
Splunk Employee
Splunk Employee

The default for the top command is 10 values. You can do either of the following to get the top 100.

... | top 100 Questions   or   ... | top limit=100 Questions

http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/top

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...