Answers for "Is there a way to use Regex (Regular Expressions) to limit digits in a search Panel?"
https://answers.splunk.com/answers/654355/is-there-a-way-to-use-regex-regular-expressions-to.html
The latest answers for the question "Is there a way to use Regex (Regular Expressions) to limit digits in a search Panel?"Answer by thambisetty
https://answers.splunk.com/answering/654530/view.html
Hi,
you may not get what you are looking for using simple XML. you need to have jquery in js file which should be used in dashboard to allow only four digits in the input field.Sat, 28 Apr 2018 11:03:17 GMTthambisettyAnswer by DalJeanis
https://answers.splunk.com/answering/654517/view.html
Okay, I'm not sure exactly what you are asking, but here's a couple of answers.
1) Supposing that you have a field `store_in` where the number is 123, and you want to pad it on the left with zeroes.
| eval store_out=substr("0000".store_in,len(store_in)+1,4)
The above code will also work if the number may be 12345, and you want to take only the RIGHTMOST 4 digits.
2) If when the number is 5-digits or more, you want to take the LEFTMOST 4 digits, then you need an if statement in there.
| eval store_out=if(len(store_in)>4,substr(store_in,4),substr("0000".store_in,len(store_in)+1,4))
The above code should work in XML as well, just remember to replace `>` with `>` and so on.
----------
Perhaps the simplest method for making it work against an input is to have the `<change>` for the input calculate a second token, and use that second token in the search, but that's a personal preference.Fri, 27 Apr 2018 22:36:05 GMTDalJeanis