Logic Machine Forum
[?] random alert via mail - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: [?] random alert via mail (/showthread.php?tid=2125)



[?] random alert via mail - Allesreinwasgeht - 24.06.2019

HI

sceneario:

one of the group adresses formated as 1.005 is giving 'alert'

problem:

send goup adress(es) via mail.

question:

is there any posible fitler integrated apart form a huge script?

(Mailing part is solved)


RE: [?] random alert via mail - Daniel - 24.06.2019

Hi
Can you explain what filter do you want?
BR


RE: [?] random alert via mail - admin - 24.06.2019

The easiest way to send multiple group address values is to assign a tag.
This example will output one name = value pair per line for all objects with alert tag:
Code:
values = {}
objects = grp.tag('alert')
for _, obj in ipairs(objects) do
  value = string.format('%s = %s', tostring(obj.name), tostring(obj.value))
  values[ #values + 1 ] = value
end
result = table.concat(values, '\r\n')
log(result)



RE: [?] random alert via mail - Allesreinwasgeht - 24.06.2019

(24.06.2019, 08:24)admin Wrote: The easiest way to send multiple group address values is to assign a tag.
This example will output one name = value pair per line for all objects with alert tag:
Code:
values = {}
objects = grp.tag('alert')
for _, obj in ipairs(objects) do
 value = string.format('%s = %s', tostring(obj.name), tostring(obj.value))
 values[ #values + 1 ] = value
end
result = table.concat(values, '\r\n')
log(result)
THX!
its close to my target. I didnt want need to tagging before, but its fine.
My aim was to filter groups in format 1.005 set to 'true' to create a alert mail including all alerts in case of alarts only.
Best