Splunk Search

How do I limit a search to everything except the top 1

CoryC
Engager

How do I grab all of the versions of Splunk EXCEPT the top 1, basically the opposite of

index=winconfig sourcetype="WMIC:InstalledProduct" Name="*UniversalForwarder*"
| top limit=1 Version
| table Version

It would be nice if there was a top limit=-1 component.

 

Or,

How do I negate a subsearch?

index=winconfig sourcetype="WMIC:InstalledProduct" Name="*UniversalForwarder*"
[search index=winconfig sourcetype="WMIC:InstalledProduct" Name="*UniversalForwarder*"
| top limit=1 Version
| table Version]
| dedup host, Version
| table host Name Version

I want to search for all computers with other versions of Splunk

Labels (1)
Tags (3)
0 Karma

dtburrows3
Builder

I think this SPL tacked on to the end of your search will work assuming the versioning follows Semantic Versioning convention.

| stats
        dc(host) as dc_hosts
           by Version
    | eval
        major_version=mvindex(split(Version, "."), 0),
        minor_version=mvindex(split(Version, "."), 1),
        patch_version=mvindex(split(Version, "."), 2),
        minor_patch_version=mvindex(split(Version, "."), 3)
    | sort 0 -major_version, -minor_version, -patch_version, -minor_patch_version
    | fields - *_version
    | eventstats
        first(Version) as latest_version
    | where NOT 'Version'=='latest_version'
0 Karma
Get Updates on the Splunk Community!

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 ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...