Splunk Search

Dew Point Calculation

adrianrepublic
Explorer

I am trying to produce or calculate the Dew Point in Celsius of data in two separate indexes.

I believe the offcial Dew point formula is Td = T - ((100 - RH)/5.)

I want to basically use this formula to produce Dew point using relative humidity on one index with temperature on another index

0 Karma
1 Solution

to4kawa
Ultra Champion

Assuming that the measurement times at the two indexes are the same,

index=relative_humidity_index OR index=temperature_index
|stats avg(relative_humidity) as relative_humidity avg(temperature) as temperature by _time
|eval dew_point=temprature-((100-relative_humidity)/5.0)

View solution in original post

0 Karma

to4kawa
Ultra Champion

Assuming that the measurement times at the two indexes are the same,

index=relative_humidity_index OR index=temperature_index
|stats avg(relative_humidity) as relative_humidity avg(temperature) as temperature by _time
|eval dew_point=temprature-((100-relative_humidity)/5.0)
0 Karma

adrianrepublic
Explorer

That nearly worked. Thanks 🙂

(index="index1" device=* customer_id=*) OR (index="weather") | stats avg(hum) as relative_humidity avg(temp) as temperature by customer_id | eval dew_point=temperature-((100-relative_humidity)/5.0)

However something which ive noticed which could be any issue is that the both indexes have a temperature but on one index its temperature(weather index) and on the other its temp(index 1). When i change it to temperature it doesnt seem to produce/include the values from the "weather" index.

I basically want the temperature from the weather index vs humidity of the index1

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Easily handled.

(index="index1" device= customer_id=) OR (index="weather") 
| eval temperature=coalesce(temperature, temp)
| stats avg(hum) as relative_humidity avg(temp) as temperature by customer_id 
| eval dew_point=temperature-((100-relative_humidity)/5.0)
---
If this reply helps you, Karma would be appreciated.
0 Karma

adrianrepublic
Explorer

richgalloway that seems to have done the job 🙂 Thanks very much.

0 Karma
Get Updates on the Splunk Community!

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

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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