Splunk Search

Graph from key/value pairs

mateibos
New Member

Hello,

I am extracting from a database the list of the largest 20 tables. The format would be something like =:

For example:

TableSizeMB
LargestTable=2012
VeryLargeTable=2008
SomeTable=500

Obviously, the list is not fixed as some tables might become larger and make it to the list while others would disappear.

Would it be possible to have a graph of these tables and their sizes? If yes, how should I define the search?

Thank you in advance.

0 Karma

DalJeanis
Legend

As far as the search, it's pretty much trivial

your search that gets tablename and tablesize
| sort 20 - tablesize

If you want to display all 20, then in splunk I'd suggest using a horizontal bar chart. Here's some run-anywhere sample code so you can see what it looks like.

| makeresults | eval junk=mvrange(1,25) | mvexpand junk | eval tablename="T".junk | eval tablesize = random()%125 + random()%221 | sort 20 - tablesize | table tablename tablesize
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 ...