This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

Export Alert list to CSV or email

Is there any way to export the current Alert list to a CSV file or to send it via email ?

Thank you
Here's how to get CSV for alerts:
rows = { '"Date/time","Script name","Message"' }
items = db:getall('SELECT * FROM alerts ORDER BY id DESC')

for _, item in ipairs(items) do
  datetime ='%c', item.alerttime)
  rows[ #rows + 1 ] = string.format('%q,%q,%q',
    datetime, item.scriptname, item.alert)

csv = table.concat(rows, '\n')

Forum Jump: