Skip to content

Commit

Permalink
Merge pull request #4052 from bazsi/use-generic-number-in-riemann
Browse files Browse the repository at this point in the history
Use generic-number in riemann (4.0)
  • Loading branch information
MrAnno committed Aug 24, 2022
2 parents d4ebd5a + 68ab80e commit 71eb6bf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/riemann/riemann-worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "riemann.h"
#include "riemann-worker.h"
#include "scratch-buffers.h"
#include "generic-number.h"
#include "parse-number.h"

#include <riemann/simple.h>
#include <stdlib.h>
Expand Down Expand Up @@ -124,8 +126,10 @@ riemann_dd_field_integer_maybe_add(riemann_event_t *event, LogMessage *msg,

if (target->len != 0)
{
gint64 as_int = g_ascii_strtoll(target->str, NULL, 10);
riemann_event_set(event, ftype, as_int, RIEMANN_EVENT_FIELD_NONE);
GenericNumber gn;

if (parse_generic_number(target->str, &gn))
riemann_event_set(event, ftype, gn_as_int64(&gn), RIEMANN_EVENT_FIELD_NONE);
}
}

Expand Down

0 comments on commit 71eb6bf

Please sign in to comment.