Splunk Search

use subsearch

otman01
Communicator

hi every one,

I want to make a search that could give me the same result of SQL Querie

select id_product from products where price = (
select max price from products )

thank you

0 Karma
1 Solution

woodcock
Esteemed Legend

sourcetype=products | eventstats max(price) AS maxPrice | where price=maxPrice | stats values(id_product)
OR
sourcetype=products | eventstats max(price) AS maxPrice | where price=maxPrice | fields id_product

View solution in original post

0 Karma

woodcock
Esteemed Legend

sourcetype=products | eventstats max(price) AS maxPrice | where price=maxPrice | stats values(id_product)
OR
sourcetype=products | eventstats max(price) AS maxPrice | where price=maxPrice | fields id_product

0 Karma

otman01
Communicator

thank you woodcock
it works perfectly. have a nice day

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...