File: selector.lua

package info (click to toggle)
balboa 2.1.2%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,644 kB
  • sloc: ansic: 10,604; makefile: 160; python: 127; sh: 103
file content (24 lines) | stat: -rw-r--r-- 485 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- implement the process function for custom lua selectors
function process(o)
    print("observation fields:")
    print(o:rcode())
    print(o:rdata())
    print(o:rrtype())
    print(o:rrname())
    print(o:sensor_id())

    print("tags:")
    local tags = o:tags()
    for i=1,#tags do
        print(" - " .. tags[i])
    end

    print("setting tag")
    o:add_tag("foo")

    print("new tags:")
    tags = o:tags()
    for i=1,#tags do
        print(" - " .. tags[i])
    end
end