Splunk Search

can i get the one particular host information from the metadata command?

pentela114
Engager

I am using the below command and it is giving me the whole host lists in the environment, but i need for the particular host. Please suggest?

| metadata type=hosts index=*

Tags (1)

somesoni2
Revered Legend

The metadata command has only index and splunk_server (indexers/search peers) filter, so either you can filter your host information like this

| metadata type=hosts index=* | where host="YourHostHere"

OR use this to get data for just your host.

| tstats count as totalCount min(_time) as firstTime max(_time) as lastTime max(_time) as recentTime WHERE index=* host="YourHostHere"  by host
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...