Splunk Enterprise Security

How to get the size of a lookup file from Splunk search

Path Finder

Hi all,

Does anyone know how to get the file size of a lookup file from Splunk search?


0 Karma


Please try this new custom command I built:


0 Karma


Not a efficient way but works. But you need to input list of field names from the CSV file. And the file size may be accurate as it's based on number of characters.

| inputlookup myfile
| fillnull value=NULL
| eval all_fields=field1 . field2 . field3
| eval raw_len=len(all_fields) 
| stats sum(raw_len) as total_char
| eval size_in_bytes=round(total_char/1024,2)


A little nicer would be to use foreach, some options but example-

| foreach * [ | eval bytes_<<FIELD>>=len(<<FIELD>>)+1 ]
| addtotals bytes_* fieldname=bytes_row | eval bytes_row=bytes_row+1
| stats sum(bytes_row) as bytes_total

Tags (2)


Can you accept the answer if it's helped you? Thanks.

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud | Unified Identity - Now Available for Existing Splunk ...

Raise your hand if you’ve already forgotten your username or password when logging into an account. (We can’t ...

Index This | How many sides does a circle have?

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

Registration for Splunk University is Now Open!

Are you ready for an adventure in learning?   Brace yourselves because Splunk University is back, and it's ...