修复,action为toggle时截取的字符串错误
This commit is contained in:
parent
89709b0ac1
commit
8a9935b90f
|
@ -66,12 +66,12 @@ $0~/action<[0-9]+> is toggle./ {
|
|||
atime = match($0,/[0-9]{1,2}-[0-9]{1,2} ([0-9]{1,2}:){3}[0-9]{1,3}/) ? substr($0,RSTART,RLENGTH) : null;
|
||||
|
||||
if((getline conditionLine) > 0){
|
||||
adps = match(conditionLine,/toggle action: \{.*\}\}/) ? substr(substr($0,RSTART,RLENGTH),16,RLENGTH-15) : "\"not substr cmd\""
|
||||
adps = match(conditionLine,/toggle action: \{.*\}\}/) ? substr(substr(conditionLine,RSTART,RLENGTH),16,RLENGTH-15) : "\"not substr cmd\""
|
||||
}else{
|
||||
print "no more line"
|
||||
}
|
||||
|
||||
aLogJson = "{ \"time\":"atime", \"event\":\"action\", \"cmd\":"adps"}"
|
||||
aLogJson = "{ \"time\":"atime", \"event\":\"action\", \"cmd\":"adps", \"toggleAction\":true}"
|
||||
log2file(aLogJson)
|
||||
}
|
||||
|
||||
|
|
|
@ -6,4 +6,7 @@ ssh root@192.168.1.30
|
|||
|
||||
cd /tmp && tftp 192.168.1.5 -g -l logDataClean.awk
|
||||
|
||||
tail -f /tmp/tuya.log | awk -f logDataClean.awk > /dev/null &
|
||||
tail -f /tmp/tuya.log | awk -f logDataClean.awk > /dev/null &
|
||||
|
||||
|
||||
ps | grep -v 'ps \| grep' | grep -E 'awk -f|tail -f' | awk '{print $1}' | xargs kill
|
Loading…
Reference in New Issue