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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...