Weâve been working on this for a while and I got a chance to play with the Splunk Enterprise 8. And on the other side, Splunk admins out in the real world can be forced for security reasons to just flip the entire thing to force Python 3 everywhere for all apps and all pieces everywhere (and then run and hide in the broom closet as appropriate).Ä«ut I digress. As they get to feel better about such things they can ship their app with python 3 on for those pieces, eventually for all pieces. (for more read Splunkâs official post, and main docs page about this.)Īpp developers can then test their apps by flipping python 3 on for individual pieces. And last but not least, at some point in the future, Splunk will change this and the app layers will also default to python 3. The core python pieces inside Splunk itself will pretty much all be running in Python 3 out of the box, however conversely all, or pretty much all things in the app layers are still python 2 by default in 8. ![]() Still there? OK the short version is that Splunk Enterprise 8 ships both Python 2 and Python 3. 0 is coming! And it has Python 3!Äisclaimer: If you have never written any Python in Splunk and donât plan on it, this is probably not the blog post for you. ![]() =/ (Yes autoRun is very strange but if you follow the rule of only ever having one, and always having it at the top, almost all of the strangeness goes away)Ä£) and thirdly, here's a slightly cleaner version of your JS function that you may find useful. With the autoRun="true" on the Search module, the very first push on page load doesn't hide the checkbox because nobody has pushed the TimeRangePicker's data downstream yet. IN this case you should move it up to the TimeRangePicker and not have any autoRun on the Search module. It actually tells any module "when the page loads, start pushing data to all downstream from this point", and as such it should always be up at the top of the hierarchy. You have an autoRun="True" but you've made a common mistake which is to put it on the Search module thinking it tells the Search module to run it's search. For the second you meant to check the getLatestTimeTerms not getEarliestTimeTerms.Ĭhanging that alone gets it to mostly work.Ä¢) There is also a second lesser problem though. Now the checkbox goes away as soon as I change the time range and never comes back regardless of the setting.Ä¡) The main problem is that your if statement is only firing if the earliest time term is and also the earliest time term is "now". If & this.getContext().get("search").getTimeRange().getEarliestTimeTerms()="now")Īnd yes, I rebooted splunkweb to make sure application.js has been read by splunk after my change.Ä®DIT: I just found 2 errors, thanks to google developper tools.Ä¡- there was a brace missing in my javascript.Ä¢- I needed to get the context from "this". Var methodReference = (checkBoxModule) ĬheckBoxModule.onContextChange = function() ("LRO_ShowAutoRefreshCheckBox", function(checkBoxModule) But it's all there.Īnd here is the code I added in application.js: ![]() OK the code looks partly marked as code partly as regular comments. Index=os * | rex 'lvn-(?)-' | dedup Line | table Line | sort Lineįor 5 mins auto-refresh select the "Last 60 minutes" time range. It should only be visible when the user selects "Last 60 minutes" in the TimeRangePicker. The checkbox remains visible regardless of the time range I select. ![]() I wrote the code below after looking at many examples, and reviewing the modules documentation.Īnd yet, I can't get it to work.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |