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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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