Knowledge Management

Spunk indexes

ZombieT
Engager

Hello, I am fairly familiar to spunk, but I do need to improve on indexes. I am currently working on a new client environment and they have a large amount of indexes within splunk, however some of them are inactive. 

A couple of question:

>How can I determine if an index is active/connected properly

>is there an easier way to show the above; for example if there's 100 indexes how can I find out which are still active in a graph or a more visual view. 

Hope it makes sense. Thank you in advance for any advice. 

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @ZombieT,

if you have to advice your customer about indexes, remember always that an index is a silos that contains all kind of events with the same retention time and the same access grants: an index isn't a database table; you define data characteristics using sourcetype, not index.

Anyway, you can know if an index is used, and if not, when it was used for the last time running a search like this:

| eventcount summarize=false index=* | dedup index 

or better

| tstats count latest(_time) AS latest WHERE index=* BY index
| append [
   | eventcount summarize=false index=* 
   | dedup index 
   | eval count=0 
   | fields index count 
   ]
| stats sum(count) AS total values(latest) AS latest BY index
| eval 
   latest =strftime(latest,"%Y-%m-%d %H:%M:%S"),
   status=if(total=0,"No events","Last event at ".latest)
| table index status

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @ZombieT,

if you have to advice your customer about indexes, remember always that an index is a silos that contains all kind of events with the same retention time and the same access grants: an index isn't a database table; you define data characteristics using sourcetype, not index.

Anyway, you can know if an index is used, and if not, when it was used for the last time running a search like this:

| eventcount summarize=false index=* | dedup index 

or better

| tstats count latest(_time) AS latest WHERE index=* BY index
| append [
   | eventcount summarize=false index=* 
   | dedup index 
   | eval count=0 
   | fields index count 
   ]
| stats sum(count) AS total values(latest) AS latest BY index
| eval 
   latest =strftime(latest,"%Y-%m-%d %H:%M:%S"),
   status=if(total=0,"No events","Last event at ".latest)
| table index status

Ciao.

Giuseppe

ZombieT
Engager

Great response, mille grazie Giuseppe;

 

On the back of that if say the client asks to show them a simpler way for example a gui way, how do I go about checking that; thank you in advance. 

0 Karma

gcusello
SplunkTrust
SplunkTrust

@ZombieT ,

the best way is the Monitoring Console in which you have all the information about all Indexes, but if they are hundreds it will not be so easy to read!

let me know if I can help you more, or, please, accept one answer for the other people of Community.

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...