Forum Discussion
Because with batchscript, the script runs for all instances. Which instance's wildvalue did you expect back? You can only do instanceProps.get("wildvalue") on script, not batchscript.
I believe there is a way to grab from the deviceDatasourceProps the list of wildvalues, but i haven't been able to relocate the code where i saw that done.
It would be nice if someone from LM who knew how to do it chimed in here. Maybe someone from the ME team...
- skylaurman3 months agoEmployee
Here is a way to get a list of the wild values:
def listOfWildValues = datasourceinstanceProps.values().collect { it.wildvalue }
Here is a way to do as you wish with the wild values:
datasourceinstanceProps.each { instance, instanceProperties -> instanceProperties.each { it -> def wildValue = it.wildValue // Do something with wild value } }
- Anonymous3 months ago
This is the right answer. Could someone at LM please put in a DOC ticket to get this published into the support documentation or the dev guide?
- skylaurman2 months agoEmployee
Documentation has been updated to include examples: https://www.logicmonitor.com/support/logicmodules/datasources/data-collection-methods/batchscript-data-collection
- manthena20203 months agoAdvisor
To test this . I Have Executed against my server. Iam not getting any output .sample print test on collection script
- manthena20203 months agoAdvisor
My Active Discovery Print statement: println("${a}##${aa}######instance=${instanceName}")
Related Content
- 10 months ago
- 10 months ago
- 7 months ago
- 2 months ago