All Apps and Add-ons

Help to convert sql query to splunk query

sahil237888
Path Finder

Hi Experts,

Can anyone help me in converting below sql query to splunk query.I really dont have any clue for percentile_cont thing.

SELECT class_id,round(avg(percent/100,2) as percentage,
round(percentile_cont(0.05) within group (order by percent/100),3) as AmarksPerntl,
round(percentile_cont(0.09) within group (order by percent/100),3) as BmarksPerntl
from myTable group by class_id
order by 2 desc

Tags (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

You should find some helpful information at http://www.innovato.com/splunk/SQLSplunk.html .

---
If this reply helps you, Karma would be appreciated.
0 Karma

sahil237888
Path Finder

@richgalloway, this URL is not working,Not found error while browsing this URL.

0 Karma

niketn
Legend

@sahil237888 there was an extra dot at the end of the URL because of which it was not working. However, similar document you can also find in the Splunk Documentation link:

https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/SQLtoSplunk

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The link provided by @niketnilay is the one I was looking for, however, so try that.

---
If this reply helps you, Karma would be appreciated.
0 Karma

Sukisen1981
Champion

nah won't do 🙂 🙂
is it not possible for you to just post a sample of your events and fields and then tell us your expected splunk output?
that way it will be easier for us to come up with a query that fits your needs...

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