Alerting

Append column to timechart, that is a function of existing columns.

wlbaird
Engager

I have a timechart with columns A and B, I would like to add a third column C, where C=A/B

My timechart is created by:

index=...

| timechart span=10m count(_raw) AS A

| appendcols [ index= ....

| timechart span=10m count(_raw) AS B]

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@wlbaird 

You can try some thing like this also.

index="..." OR index="...." | timechart span=10m sum(eval(if(index="...",1,0))) as A  sum(eval(if(index="....",1,0))) as B | eval C=A/B

 

My Sample Search :

index="_internal" OR index="_introspection" | timechart span=10m sum(eval(if(index="_internal",1,0))) as A  sum(eval(if(index="_introspection",1,0))) as B | eval C=A/B

 

Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.
 

0 Karma

wlbaird
Engager

Thanks that worked. 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index=...
| timechart span=10m count(_raw) AS A
| appendcols [ index= ....
| timechart span=10m count(_raw) AS B]
| eval C=A/B
Get Updates on the Splunk Community!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...