Splunk Search

How to edit my timechart search with the predict command to predict a particular value?

kranthimutyala
Path Finder
index=stocks|timechart span=1d stock_price  as price |predict price

I'm using a search like this I need to predict the future stock price value of a particular stock. If I'm using any timechart function, the desired results are not being generated. Please help me on this.

Tags (3)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

From a Splunk point of view, your timechart needs a function such as avg(stock_price) or latest(stock_price) or earliest(stock_price) to churn a day's worth of spot prices into a daily average, closing, opening, etc. price.

From a reality point of view, predicting stock prices based on past values is at best challenging, more realistically it's futile.

View solution in original post

sundareshr
Legend

First, I'm not sure predicting stock price is a right use case for this command. Stock values are influenced by external factors, not all within your dataset. Having said that, if you want to forecast the values purely based on the timeseries data you could try something like this (assuming stock_price field has numeric values, no currency symbols etc)

index=stocks | timechart span=1h max(stock_price) as price | predict price
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

From a Splunk point of view, your timechart needs a function such as avg(stock_price) or latest(stock_price) or earliest(stock_price) to churn a day's worth of spot prices into a daily average, closing, opening, etc. price.

From a reality point of view, predicting stock prices based on past values is at best challenging, more realistically it's futile.

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