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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...