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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...