Splunk Search

How do I multiply a search result with dynamic value entered through a form?

chaitanyaprakas
Engager

I have a value called total produced by this search:

index="_internal" source=*license_usage.log type=Usage st($st$) | bin _time span=1d | eval KB=round(b/1024) | eval MB=round(KB/1024,2) | eval GB=round(MB/1024,2) | eval TB=round(GB/1024,2) |stats sum(MB) as Total

I want to multiply it with a dynamic value entered by a user through a form. How do I do that?

0 Karma
1 Solution

chaitanyaprakas
Engager

@sundareshr i figured it out thank you for your solution though
i have directly did like giving token for a text box as $value$
then |eval Amount=Total*$value$

View solution in original post

0 Karma

chaitanyaprakas
Engager

@sundareshr i figured it out thank you for your solution though
i have directly did like giving token for a text box as $value$
then |eval Amount=Total*$value$

0 Karma

sundareshr
Legend

Which number do you want to multiply by the user field? Total? How about

index="_internal" source=*license_usage.log type=Usage st($st$) | bin _time span=1d | eval KB=round(b/1024) | eval MB=round(KB/1024,2) | eval GB=round(MB/1024,2) | eval TB=round(GB/1024,2) |stats sum(MB) as Total | eval factor = num($factor$) | eval Total=Total*factor
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...