Find size of lookup files in Splunk Web

I needed to list the lookup tables and their sizes using Splunk Web. Here’s a query to do just that!

| rest splunk_server=local /services/data/lookup-table-files/
| rename eai:acl.app as app 
| table app title 
| search NOT title IN (*.kmz) 
| map maxsearches=990 search="| inputlookup $title$ 
| eval size=0
| foreach * [ eval size=size+coalesce(len('<<FIELD>>'),0), app="$app$", title=$title$ | fields app title size]" 
| stats sum(size) by app title
| sort - sum(size)