Answers for "Can I use modulus in Splunk to extract the decimal portion (only) of a result?"
https://answers.splunk.com/answers/562679/can-i-use-modulus-in-splunk-to-extract-the-decimal.html
The latest answers for the question "Can I use modulus in Splunk to extract the decimal portion (only) of a result?"Answer by DalJeanis
https://answers.splunk.com/answering/562140/view.html
@niketnilay - Great demo, but modulo arithmetic does simplify the calculation down to ..
... | eval decimal=(7%2)/2Sun, 13 Aug 2017 20:40:38 GMTDalJeanisAnswer by niketnilay
https://answers.splunk.com/answering/562089/view.html
Following is the run anywhere search. While modular division is possible, you are actually looking just to extract decimal places.
| makeresults
| eval dividend=7
| eval divisor=2
| eval value=dividend/divisor
| eval remainder=dividend%divisor
| eval quotient=replace(value,"(\d+).(\d+)","\1")
| eval decimal=replace(value,"(\d+)(\.\d+)","0\2")
| table dividend divisor value remainder quotient decimal
Following are the results:
dividend divisor value remainder quotient decimal
7 2 3.5 1 3 0.5Sun, 13 Aug 2017 05:18:44 GMTniketnilayAnswer by richgalloway
https://answers.splunk.com/answering/562072/view.html
Splunk does support the modulus (%) operator.Sat, 12 Aug 2017 23:04:04 GMTrichgalloway