Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file-meter: custom format not working correctly #24

Closed
rgr-rgr opened this issue Mar 19, 2014 · 2 comments
Closed

file-meter: custom format not working correctly #24

rgr-rgr opened this issue Mar 19, 2014 · 2 comments
Labels

Comments

@rgr-rgr
Copy link

rgr-rgr commented Mar 19, 2014

    {
     "enabled" : true,
     "protocol" : "file",
     "path" : "/sys/class/thermal/thermal_zone0/temp",
     "format" : "$v",        /* a format string for parsing complex logfiles */
                             /* arbitrary text and whitespaces are  allowed, see 'scanf()' */
                             /* at least $v has to be used */
                             /* $i => identifier, $v => value, $t => timestamp */
     "rewind" : true,        /* reset file pointer each interval to  the beginning of the file */
     "interval" : 2,         /* of ommitted, we will try to listen on changes with inotify */
     "identifier" : "dummy",
     "channel" : {
             "uuid" : "f6ff48d0-aeac-11e3-b2ed-3bbb8f66a68d",
             "middleware" : "http://localhost/middleware.php"
             }
     } // meter

result:
[Mar 18 16:20:06][] MeterFile::read: 32, 32
[Mar 18 16:20:06][] MeterFile::read: '32552'
[Mar 18 16:20:06][] MeterFile::read: -0.000000, ▒, 0
[Mar 18 16:20:06][mtr1] Got 1 new readings from meter:
[Mar 18 16:20:06][mtr1] Reading: id=▒/StringItentifier: value=-0.00 ts=0.000
[Mar 18 16:20:06][chn1] ==> number of tuples: 0

The file contains "32552".

I expected that $v would contain "32552".

@r00t- r00t- changed the title file: custom format wrong parsed file-meter: custom format not working correctly Mar 19, 2014
@r00t-
Copy link
Contributor

r00t- commented Sep 29, 2014

@mbehr1
Copy link
Contributor

mbehr1 commented Dec 30, 2014

see #91

@andig andig closed this as completed Jan 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants