Splunk Search

Why isn't my search showing the full results?

splunker969
Communicator

When I search for this query it shows wrong results ?

|metadata type=hosts index=* |lookup domain.csv host output domain datacenter host IP |search domain=Y|eval age=(now()-recentTime)|convert ctime(*Time)| append[ |inputlookup domain.csv ] | dedup host | fields host IP domain datacenter lastTime age totalCount| sort lastTime

When I serach for this query shows full results ?

host=wdc |stats count by host

Any help .

0 Karma
1 Solution

DalJeanis
Legend

According to this answer by @somesoni2, metadata is not time bound.

As such, it is never going to match exactly with numbers you get from the other search.

Here's a quote from the metadata documentation

In small testing environments, the data is complete. However, in environments with large numbers of values for each category, the data might not be complete. This is intentional and allows the metadata command to operate within reasonable time and memory usage.

View solution in original post

DalJeanis
Legend

According to this answer by @somesoni2, metadata is not time bound.

As such, it is never going to match exactly with numbers you get from the other search.

Here's a quote from the metadata documentation

In small testing environments, the data is complete. However, in environments with large numbers of values for each category, the data might not be complete. This is intentional and allows the metadata command to operate within reasonable time and memory usage.

splunker969
Communicator

Thanks @ DalJeanis

lfedak_splunk
Splunk Employee
Splunk Employee

Hey @splunker969, if they solved your problem, remember to "√Accept" an answer to award karma points 🙂

0 Karma

splunker969
Communicator

sure , .@ ifedak ,the problem was not resolved .Thanks 🙂

0 Karma

sbbadri
Motivator

try this
metadata type=hosts index=* |lookup domain.csv host OUTPUTNEW domain datacenter host IP |eval test=if(domain=="Y", "Logging In", "Not Logging In") |eval age=(now()-recentTime)|convert ctime(*Time)| append[ |inputlookup domain.csv ] | dedup host | fields host IP domain datacenter lastTime age test
totalCount| sort lastTime

0 Karma

splunker969
Communicator

@sbbadri No ,results after searching above query ,Thanks @sbbadri

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi splunker969
did you tried

| metasearch index=* 
| lookup domain.csv host OUTPUT domain datacenter host IP 
| search domain=Y 
| eval age=(now()-recentTime) 
| convert ctime(*Time) 
| append [ |inputlookup domain.csv ] 
| dedup host 
| fields host IP domain datacenter lastTime age totalCount
| sort lastTime

?
Anyway in your search there is something strange: you append a lookup rows (without date/time field) to a search with date/time and then you perform a dedup by host (deleting in this way some results maybe with time and age) and then you sort results by lastTime that it isn't in the lookup, what do you want as result?

Bye.
Giuseppe

0 Karma

splunker969
Communicator

Actually we are trying to right above search with logging list and not logging list to be in same list .So we used that above search.

0 Karma

splunker969
Communicator

Thanks @ cusello

0 Karma

DalJeanis
Legend

When you coded this...

| lookup domain.csv host output domain datacenter host IP 

I suspect you may have meant this...

| lookup domain.csv host OUTPUT domain datacenter host IP 
0 Karma

splunker969
Communicator

I dont see any change after changing Capital OUTPUT .

0 Karma

splunker969
Communicator

Iam not sure why the metadata search is not showing full results .

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...