Splunk Search

How to build a search to have a table with specific fields

NAVEEN_CTS
Path Finder

Hi ,
I'm trying to have Splunk knowledge inventory.
Could you help me in building the search to have the table with the following fields:

Sourcetype , Fields , TA Used , Max Index size , Retention period , Ingestion Method(UF/HF) By Index.

So far, the search that I have built:

| tstats count WHERE index=* OR sourcetype=* by index,sourcetype |join index [| rest  /services/data/indexes splunk_server="*" | fields title, frozenTimePeriodInSecs, maxTotalDataSizeMB, currentDBSizeMB totalEventCount  | eval frozenTimePeriodInSecs=(frozenTimePeriodInSecs/60/60/24)." days" | eval maxTotalDataSizeMB=tostring(maxTotalDataSizeMB/2014, "commas")." GB"  | rename maxTotalDataSizeMB AS "Max Index Size" frozenTimePeriodInSecs AS "Max Index Retention",  title AS index, currentDBSizeMB as Current_DB_Size(MB), totalEventCount as TotalEventCount] | stats values(sourcetype) AS sourcetype values(Max Index Size) as Max_Index_Size values(Max Index Retention) as Retention by index |mvexpand sourcetype

With this search I have got sourcetype , Index size , Retention Period and Max Index size.

Now I need help on getting remaining fields.

0 Karma

NAVEEN_CTS
Path Finder

Missed index =* and sourcetype=* #updated search

| tstats count WHERE index=* OR sourcetype=* by index,sourcetype |join index [| rest /services/data/indexes splunk_server="*" | fields title, frozenTimePeriodInSecs, maxTotalDataSizeMB, currentDBSizeMB totalEventCount | eval frozenTimePeriodInSecs=(frozenTimePeriodInSecs/60/60/24)." days" | eval maxTotalDataSizeMB=tostring(maxTotalDataSizeMB/2014, "commas")." GB" | rename maxTotalDataSizeMB AS "Max Index Size" frozenTimePeriodInSecs AS "Max Index Retention", title AS index, currentDBSizeMB as Current_DB_Size(MB), totalEventCount as TotalEventCount] | stats values(sourcetype) AS sourcetype values(Max Index Size) as Max_Index_Size values(Max Index Retention) as Retention by index |mvexpand sourcetype

0 Karma

adonio
Ultra Champion

what is your final output should look like? did you try and look at the Monitoring Console? seems like it has out of the box dashboards that fits your use case

0 Karma
Get Updates on the Splunk Community!

Enter the Dashboard Challenge and Watch the .conf24 Global Broadcast!

The Splunk Community Dashboard Challenge is still happening, and it's not too late to enter for the week of ...

Join Us at the Builder Bar at .conf24 – Empowering Innovation and Collaboration

What is the Builder Bar? The Builder Bar is more than just a place; it's a hub of creativity, collaboration, ...

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...