whats the frequency of the letter , in:
hi, i am working on a dashboard that will allow me to search up a store and it will give me data on that store. i am trying to limit my store search input panel to only allow 4 digits in it. i know the regex (regular expressions) code for that is /d/d/d/d however, i am unsure how to implement that into my store search input panel.
this is what i have so far, using my token value $store_num$ allows me to change the panels on my dashboard to all the same store. i dont know a whole lot about splunk, but a co-worker mentioned maybe using a condition in my source could accomplish what i need, but after googling and searching splunk answers, i couldnt find what i wanted.
please let me know if you need more information or if this can even be done. thanks splunk community!
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.
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.
the above code should work in xml as well, just remember to replace > with &gt; 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 thats a personal preference.
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.
i read his question as that he is looking for input restriction / validation for a text input on a dashboard. (for which i am not aware of any way to do that in splunk).
@frankvi - if you think about it broadly, theres a way to do almost everything that isnt contradicting part of the underlying architecture. in this case, for example, you could have the input useits <change> section to do the same validation and set a token with the validated value to be used.
it might also be possible to have it update the input with the desired value, but id have to test and verify that the specific method of updating did not create a race condition.
however, setting a different token, and displaying it, is not a problem.
user
The text includes 20 ","s in total.
assistant