Getting Data In

how do i find where each hosts are indexing data

ranjitbrhm1
Communicator

the reason for this is because someone made a mix-up on the UF and then some hosts are indexing to the wrong index. Is there an easy way to find the Index to which each hosts are indexing different data?

Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi ranjitbrhm1,
try something like this:

| metasearch index=*
| stats values(indexes) AS indexes count by host

In this way you have all the indexes for each host.

To correct errors, it could be useful to have also sources, so you can intervene:

| metasearch index=*
| stats values(sources) AS sources count BY host index

To have all the sources when some host logs are archived.

Have an Happy Easter.
Bye.
Giuseppe

0 Karma

niketn
Legend

You can use either tstats or metadata command on your index to get stats by host

| tstats count where index="<yourIndexName>" by host

Or

| metadata type=hosts where index="<yourIndexName>"
| fieldformat firstTime=strftime(firstTime,"%Y/%m/%d %H:%M:%S")
| fieldformat lastTime=strftime(lastTime,"%Y/%m/%d %H:%M:%S")
| table host firstTime lastTime totalCount
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...