Splunk Search

Display data

Communicator

How would I display the following data which is part of CSV file? I am looking for a command to do that. top is not working, I can't think of other commands to display
Code Description
200 Success
503 Service unavailable
406 Not Acceptable Client
400 Bad Request Error
408 Request Timeout
500 Internal Server Error
404 Page Not Found
505
403

I want blank values for 505 and 403 to be displayed so that I can try fillnull command.

Tags (1)
0 Karma

Esteemed Legend

Like this?

| inputlookup YourLookupFileNameHere.csv
| stats values(*) AS * BY Code Description
| fillnull Description value="UNKNOWN"
0 Karma

SplunkTrust
SplunkTrust

Hi @palisetty,
thanks you for your estimate!

Anyway the solution is the one hinted by @vnravikumar: if you already have loaded your csv in a lookup (called e.g. ws_codes.csv) you can use it in three ways using two commands inputlookup and lookup:

If instead you still haven't loaded the csv in the lookup you have to follow two ways:

  • Use Lookup Editor app (the easiest!);
  • create a new lookup in [Settings -- Lookups -- Lookup table files-- Add new].

In both cases, remember to create a Lookup Definition [Settings -- Lookups -- Lookup definition -- Add new].

Ciao and Happy New Year.
Giuseppe

Communicator

@gcusello Actually, I didn't want to use lookup.
I am so stupid but later figured it how simple it is.
Just upload the file as I am an Administrator on my machine. Then use head or table commands. then use fillnull value=whatevervalue.

Thank you again. Hope you had a wonderful Christmas

0 Karma

SplunkTrust
SplunkTrust

If you are looking for answers to the exam, ask such questions.
You mentioned in the video, right?

Transforming command

Communicator

Ravi, they are not part of lookup. any simple commands would do? I will try to display from lookup too

0 Karma

Champion

Hi

Whether that file is part of lookup, if so try with inputlookup or lookup commands

Communicator

@gcusello any help please

0 Karma