Splunk Search

tstats and inputlookup case sensitive problem

splunkreal
Motivator

We had problem this week with logs indexed with lower or upper case hostnames. We run this query in a scheduled macro :

It seems that our eval functions don't do the job.

Query attached.

Thanks.

link text

* If this helps, please upvote or accept solution 🙂 *
0 Karma
1 Solution

splunkreal
Motivator

Solved by adding after tstats :

| eval host = lower(host) | stats max(latest) as latest,min(earliest) as earliest by host source

* If this helps, please upvote or accept solution 🙂 *

View solution in original post

0 Karma

splunkreal
Motivator

Solved by adding after tstats :

| eval host = lower(host) | stats max(latest) as latest,min(earliest) as earliest by host source

* If this helps, please upvote or accept solution 🙂 *
0 Karma

splunkreal
Motivator

The problem is with tstats which is case sensitive, I haven't problem with stats but it's very slow.

* If this helps, please upvote or accept solution 🙂 *
0 Karma

somesoni2
SplunkTrust
SplunkTrust

Assuming your lookup table has host names in lower case, but indexed data has various case, try this

| tstats latest(_time) as latest,earliest(_time) as earliest WHERE index = * by host source | eval host=lower(host) | search [| inputlookup liste_serv |  eval host = host+"*"  | eval source=split(logsSystem, "#") | mvexpand source | table host source] | eval host = lower(replace(host,".production.com","")) | eval timeNow=relative_time( now(), "-8h@h") | where latest<timeNow | eval last=strftime(latest, "%Y-%m-%d %T") | eval first=strftime(earliest, "%Y-%m-%d %T") | sort - last | stats list(source) as source list(last) as "lastApparition" list(latest) as latest list(count) as count by host
0 Karma

splunkreal
Motivator

Thanks somesoni2 however we already tried it by adding | eval host=lower(host) before inputlookup 😞

* If this helps, please upvote or accept solution 🙂 *
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...