Is it somehow possible to read a logfile containing several lines into variable?
My logfile looks like this
name: Woonkamer temp: 19.31 setptemp: 20.5 id: 2084864 mode: Foll until: 00:00:00
name: Keuken temp: 20.14 setptemp: 20.0 id: 2084865 mode: Foll until: 00:00:00
name: Badkamer temp: 18.91 setptemp: 15.0 id: 2084866 mode: Foll until: 00:00:00
name: Opkamer temp: 19.99 setptemp: 18.0 id: 2084867 mode: Foll until: 00:00:00
name: Hal temp: 20.4 setptemp: 20.0 id: 2084868 mode: Foll until: 00:00:00
name: Werkkamer temp: 21.38 setptemp: 21.0 id: 2158952 mode: Temp until: 19:00:00
name: Slp. Kamer temp: 10.18 setptemp: 10.0 id: 2158953 mode: Foll until: 00:00:00
I created a logfile reader device with the following specififcations:
{
"file": "/home/pi/evohome-client/temp_per_zone.log",
"attributes": [
{
"name": "name",
"type": "string"
},
{
"name": "temp",
"type": "number"
},
{
"name": "setptemp",
"type": "number"
},
{
"name": "id",
"type": "number"
},
{
"name": "mode",
"type": "string"
},
{
"name": "time",
"type": "string"
}
],
"lines": [
{
"match": "name: (.*)\\btemp",
"name": "$1"
},
{
"match": "temp: (\\d*.\\d*)",
"temp": "$1"
},
{
"match": "setptemp: (\\d*.\\d*)",
"setptemp": "$1"
},
{
"match": "id: (\\d*)",
"id": "$1"
},
{
"match": "mode: (\\w*)",
"mode": "$1"
},
{
"match": "until: (\\d*:\\d*:\\d*)",
"time": "$1"
}
],
"xAttributeOptions": [],
"id": "evohome-zones",
"name": "evohome-zones",
"class": "LogWatcher"
}
This device only reads the first line.
How can I read all lines, from this logfile? Is this possible?