Forum Discussion
Piecing together what you’re trying to do here. You want to know how many blocked there are per SPID, right? Then yes, your discovery should be outputting something like this:
SPID1##SPID 1
SPID3##SPID 3
SPID4##SPID 4
SPID5##SPID 5
SPID6##SPID 6
SPID7##SPID 7
SPID8##SPID 8
SPID9##SPID 9
SPID10##SPID 10
SPID11##SPID 11
SPID12##SPID 12
SPID13##SPID 13
SPID14##SPID 14
etc. etc.
Your collection script is pretty close to what you eventually want. Instead of
"SPID = ${row.spid}\nBLOCKED = ${row.blocked}\n"
You would have this:
println("SPID${row.spid}.BLOCKED: ${row.blocked}")
Your datapoint would be defined as a multi-line key-value pair and the key would be:
##WILDVALUE##.BLOCKED
When your collection script outputs this:
SPID1.BLOCKED: 0
SPID3.BLOCKED: 0
SPID4.BLOCKED: 0
SPID5.BLOCKED: 0
SPID6.BLOCKED: 0
SPID7.BLOCKED: 0
SPID8.BLOCKED: 0
SPID9.BLOCKED: 0
SPID10.BLOCKED: 0
SPID11.BLOCKED: 0
SPID12.BLOCKED: 0
SPID13.BLOCKED: 0
SPID14.BLOCKED: 0
etc. etc.
LM will automatically take care of matching up the lines in your collection output with the lines in your discovery output based on your datapoint key. The key dictates that LM should look for lines in your collection output that have the WILDVALUE, then a dot, then the word “BLOCKED”, then a colon, then a number. If the WILDVALUE of your collection script output line matches the WILDVALUE of a line in the discovery script, then the data will be matched up and added to that instance.
Related Content
- 2 years ago
- 3 days ago
- 2 years ago