Fixed a bug with a off by one severity number in sicslogquery.c

Added a number of python utilities for querying the mongoDB
This commit is contained in:
2016-04-28 10:41:36 +02:00
parent 78f6b92960
commit 24107e993b
4 changed files with 75 additions and 1 deletions

View File

@ -160,7 +160,7 @@ int sicslogQuery(int argc, char *argv[], ResultCallback_t func, void *userData)
build the query
*/
snprintf(jsonQuery, sizeof(jsonQuery),"{ \"timestamp\" : {\"$gt\": %ld, \"$lt\": %ld}, \"severity\": {\"$lte\": %d}",
from,to,severity-1);
from,to,severity);
if(sub != NULL){
snprintf(subQuery,sizeof(subQuery),", \"sub\" : \"%s\"", sub);
strncat(jsonQuery,subQuery,sizeof(jsonQuery));