Using Splunk to Predict the Weather
Planning a camping trip can take a lot of time. You have to figure out how many tents you need, what kind of tents, how much food to pack, what tools you need to bring, what clothes you need to wear, etc. A lot of the plans can be based off of one thing, the weather. Going to a rain forest? Pack a heavy rain jacket, a couple of tarps, and waterproof everything. Going to the desert? Pack a sun hat, shorts, and containers for water. Unfortunately, unless you know you’re going to a place with extreme weather, you might not be able to perfectly predict the weather.
This is where Splunk can help. Utilizing historical data from the past three years, I can identify the trends in heat waves and rainstorms to help me plan out my trips.
I can use past temperature data, specified by time and location from the DarkSky API, to look at past weather phenomena. If I want to take a camping trip to the Poconos, all I have to do is put in the latitude and longitude of the location, use a custom script that I wrote to download the data en masse, ingest it into Splunk, and look at past weather trends. I can then compare it to current weather data to see how long the weather will stay cold or stay warm.
The DarkSky API is a perfect weather site to use with Splunk. It can be customized to get historical data from any location at any time in the past. Additionally, it returns it in a very nice JSON format, which slots perfectly into Splunk by setting the field INDEXED_EXTRACTIONS to json in the props.conf.
Additionally, I can use precipitation data to do a similar thing; I can use past historical data to see how long it will be raining or snowing, or how windy it will be.
Weather can be a fickle and unpredictable phenomena. We are a long way off from being able to perfectly predict the weather; even 24-hours in advance. Using tools like Splunk and DarkSky API, we can make rough estimates and plan trips based off of historical data. The above is just a quick glimpse into the possibilities of combining Splunk and the DarkSky API. Other fields given in the json include, but aren't limited to: the cloud cover, the moon cycle, the sunrise and sunset time, the air pressure, and the ozone. What we can do with this amount of weather data is only limited to one's imagination.