Trying to understand filter syntax
Antony Stone
Antony.Stone at arbtt.open.source.it
Sun Jul 2 11:08:22 CEST 2017
Hi.
I've just discovered and started to use arbtt.
I've been collecting stats for a few days now, and I'm trying to create some
filtering rules for my type of activity, so I can get some useful reports out
of it.
I've read https://arbtt.nomeata.de/doc/users_guide/configuration.html and
https://arbtt.nomeata.de/doc/users_guide/effective-use.html (in fact I've read
all of https://arbtt.nomeata.de/doc/users_guide/index.html )
However, something escapes me about the syntax used.
For example, I can do:
$ arbtt-stats -f '$sampleage < 24:00'
and it shows me an analysis for the past 24 hours.
However, I'd like to do an analysis for yesterday, not the 24 hours up to this
moment right now, so I'm trying to express that.
If I try:
$ arbtt-stats -f '$date >= 2017-07-01 && $date < 2017-07-02'
it tells me:
arbtt-stats: "commad line parameter" (line 1, column 14):
unexpected "-"
expecting digit, "=~", ">=", ">", "==", "=", "<" or "<="
Cannot compare expressions of type Date and type Integer
So, 2017 is clearly being interpreted as an integer, and then the - sign
confuses the parser.
So, let's try it as a string:
$ arbtt-stats -f '$date >= "2017-07-01" && $date < "2017-07-02"'
arbtt-stats: "commad line parameter" (line 1, column 23):
unexpected "&"
expecting "=~", ">=", ">", "==", "=", "<" or "<="
Cannot compare expressions of type Date and type String
So, I can't compare a Date with an Integer, and I can't compare a Date with a
String - what *can* I compare a Date with?
I'm looking at the example given in the documentation, about ¾ of the way down
https://arbtt.nomeata.de/doc/users_guide/configuration.html ):
$date >= 2001-01-01 && $date <= 2001-01-02
and I can't see what's different about my version for this year...
Can someone please explain how I can create a filter which evaluates to "the 24
hours of yesterday"?
Thanks,
Antony.
--
"Can you keep a secret?"
"Well, I shouldn't really tell you this, but... no."
Please reply to the list;
please *don't* CC me.
More information about the arbtt
mailing list