commit
3b1999130c
@ -0,0 +1 @@
|
||||
SOURCES/liblognorm-2.0.6.tar.gz
|
@ -0,0 +1 @@
|
||||
61c72b58f511924ab80401b0719803963872c73d SOURCES/liblognorm-2.0.6.tar.gz
|
@ -0,0 +1,204 @@
|
||||
From eb2299a0897577048205e4d8a331168d82ce09d0 Mon Sep 17 00:00:00 2001
|
||||
From: Noriko Hosoi <nhosoi@momo7.localdomain>
|
||||
Date: Thu, 26 Jul 2018 17:18:38 -0700
|
||||
Subject: [PATCH] Add a parameter skipempty to the json field type.
|
||||
|
||||
If skipempty is set as follows, empty json objects are dropped from
|
||||
the parsed result.
|
||||
%field_name:json:skipempty%
|
||||
|
||||
If any parameter other than "skipempty" is given ("bogus" in this
|
||||
example), an error message "invalid flag for JSON parser: bogus"
|
||||
is issued.
|
||||
---
|
||||
src/parser.c | 127 ++++++++++++++++++++++++++++++++++++++++++
|
||||
src/parser.h | 2 +-
|
||||
src/pdag.c | 2 +-
|
||||
3 files changed, 129 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/parser.c b/src/parser.c
|
||||
index 77407c6..6736c6f 100644
|
||||
--- a/src/parser.c
|
||||
+++ b/src/parser.c
|
||||
@@ -2325,6 +2325,85 @@ PARSER_Parse(v2IPTables)
|
||||
return r;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Delete children of the given object if it has children and they are empty.
|
||||
+ *
|
||||
+ * return 0 if object is not empty
|
||||
+ * return 1 if object is empty
|
||||
+ * return < 0 if error
|
||||
+ *
|
||||
+ * Caller should do this:
|
||||
+ * if (jsonSkipEmpty(obj) > 0) {
|
||||
+ * json_object_put(obj);
|
||||
+ * obj = NULL;
|
||||
+ * }
|
||||
+ * or otherwise not use obj if jsonSkipEmpty returns > 0.
|
||||
+ */
|
||||
+static int
|
||||
+jsonSkipEmpty(struct json_object *__restrict__ json)
|
||||
+{
|
||||
+ int rc = 0;
|
||||
+ struct json_object *val = NULL;
|
||||
+
|
||||
+ if(json == NULL) {
|
||||
+ rc = 1;
|
||||
+ goto finalize_it;
|
||||
+ }
|
||||
+
|
||||
+ switch (json_object_get_type(json)) {
|
||||
+ case json_type_string:
|
||||
+ rc = json_object_get_string_len(json) == 0;
|
||||
+ break;
|
||||
+ case json_type_array:
|
||||
+ {
|
||||
+ int i;
|
||||
+ int arrayLen = json_object_array_length(json);
|
||||
+ for (i = 0 ; i < arrayLen ; ++i) {
|
||||
+ val = json_object_array_get_idx(json, i);
|
||||
+ if ((rc = jsonSkipEmpty(val)) > 0) {
|
||||
+ /* delete the empty item and reset the index and arrayLen */
|
||||
+ json_object_array_del_idx(json, i--);
|
||||
+ arrayLen = json_object_array_length(json);
|
||||
+ } else if (rc < 0) {
|
||||
+ goto finalize_it;
|
||||
+ }
|
||||
+ }
|
||||
+ rc = json_object_array_length(json) == 0;
|
||||
+ break;
|
||||
+ }
|
||||
+ case json_type_object:
|
||||
+ {
|
||||
+ struct json_object_iterator it = json_object_iter_begin(json);
|
||||
+ struct json_object_iterator itEnd = json_object_iter_end(json);
|
||||
+ while (!json_object_iter_equal(&it, &itEnd)) {
|
||||
+ val = json_object_iter_peek_value(&it);
|
||||
+ if ((rc = jsonSkipEmpty(val)) > 0) {
|
||||
+ json_object_object_del(json, json_object_iter_peek_name(&it));
|
||||
+ } else if (rc < 0) {
|
||||
+ goto finalize_it;
|
||||
+ }
|
||||
+ json_object_iter_next(&it);
|
||||
+ }
|
||||
+ rc = json_object_object_length(json) == 0;
|
||||
+ }
|
||||
+ case json_type_null:
|
||||
+ case json_type_boolean:
|
||||
+ case json_type_double:
|
||||
+ case json_type_int:
|
||||
+ default: break;
|
||||
+ }
|
||||
+finalize_it:
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Parameters for field type json
|
||||
+ * skipempty - skips empty json objects.
|
||||
+ * - %field_name:json:skipempty%
|
||||
+ */
|
||||
+struct data_JSON {
|
||||
+ int skipempty;
|
||||
+};
|
||||
/**
|
||||
* Parse JSON. This parser tries to find JSON data inside a message.
|
||||
* If it finds valid JSON, it will extract it. Extra data after the
|
||||
@@ -2340,6 +2419,7 @@ PARSER_Parse(v2IPTables)
|
||||
PARSER_Parse(JSON)
|
||||
const size_t i = *offs;
|
||||
struct json_tokener *tokener = NULL;
|
||||
+ struct data_JSON *const data = (struct data_JSON*) pdata;
|
||||
|
||||
if(npb->str[i] != '{' && npb->str[i] != ']') {
|
||||
/* this can't be json, see RFC4627, Sect. 2
|
||||
@@ -2368,6 +2448,20 @@ PARSER_Parse(JSON)
|
||||
if(value == NULL) {
|
||||
json_object_put(json);
|
||||
} else {
|
||||
+ if (data && data->skipempty) {
|
||||
+ int rc = jsonSkipEmpty(json);
|
||||
+ if (rc < 0) {
|
||||
+ json_object_put(json);
|
||||
+ FAIL(LN_WRONGPARSER);
|
||||
+ } else if (rc > 0) {
|
||||
+ /*
|
||||
+ * json value is empty.
|
||||
+ * E.g., {"message":""}, {"message":[]}, {"message":{}}
|
||||
+ */
|
||||
+ json_object_put(json);
|
||||
+ FAIL(0);
|
||||
+ }
|
||||
+ }
|
||||
*value = json;
|
||||
}
|
||||
|
||||
@@ -2376,7 +2470,40 @@ PARSER_Parse(JSON)
|
||||
json_tokener_free(tokener);
|
||||
return r;
|
||||
}
|
||||
+PARSER_Construct(JSON)
|
||||
+{
|
||||
+ int r = 0;
|
||||
+ struct json_object *ed;
|
||||
+ struct data_JSON *data = NULL;
|
||||
+ char *flag;
|
||||
|
||||
+ if(json == NULL)
|
||||
+ goto done;
|
||||
+
|
||||
+ if(json_object_object_get_ex(json, "extradata", &ed) == 0) {
|
||||
+ /* No JSON parameter */
|
||||
+ goto done;
|
||||
+ }
|
||||
+ data = (struct data_JSON*) calloc(1, sizeof(struct data_JSON));
|
||||
+ flag = json_object_get_string(ed);
|
||||
+ if (strcasecmp(flag, "skipempty") == 0) {
|
||||
+ data->skipempty = 1;
|
||||
+ } else {
|
||||
+ ln_errprintf(ctx, 0, "invalid flag for JSON parser: %s", flag);
|
||||
+ r = LN_BADCONFIG;
|
||||
+ goto done;
|
||||
+ }
|
||||
+ *pdata = data;
|
||||
+done:
|
||||
+ if(r != 0) {
|
||||
+ free(data);
|
||||
+ }
|
||||
+ return r;
|
||||
+}
|
||||
+PARSER_Destruct(JSON)
|
||||
+{
|
||||
+ free(pdata);
|
||||
+}
|
||||
|
||||
/* check if a char is valid inside a name of a NameValue list
|
||||
* The set of valid characters may be extended if there is good
|
||||
diff --git a/src/parser.h b/src/parser.h
|
||||
index 38be62d..5b4a821 100644
|
||||
--- a/src/parser.h
|
||||
+++ b/src/parser.h
|
||||
@@ -70,7 +70,7 @@ PARSERDEF_NO_DATA(Time24hr);
|
||||
PARSERDEF_NO_DATA(Duration);
|
||||
PARSERDEF_NO_DATA(IPv4);
|
||||
PARSERDEF_NO_DATA(IPv6);
|
||||
-PARSERDEF_NO_DATA(JSON);
|
||||
+PARSERDEF(JSON);
|
||||
PARSERDEF_NO_DATA(CEESyslog);
|
||||
PARSERDEF_NO_DATA(v2IPTables);
|
||||
PARSERDEF_NO_DATA(CiscoInterfaceSpec);
|
||||
diff --git a/src/pdag.c b/src/pdag.c
|
||||
index 0768e99..9feb755 100644
|
||||
--- a/src/pdag.c
|
||||
+++ b/src/pdag.c
|
||||
@@ -90,7 +90,7 @@ static struct ln_parser_info parser_lookup_table[] = {
|
||||
PARSER_ENTRY_NO_DATA("duration", Duration, 16),
|
||||
PARSER_ENTRY_NO_DATA("cisco-interface-spec", CiscoInterfaceSpec, 4),
|
||||
PARSER_ENTRY_NO_DATA("name-value-list", NameValue, 8),
|
||||
- PARSER_ENTRY_NO_DATA("json", JSON, 4),
|
||||
+ PARSER_ENTRY("json", JSON, 4),
|
||||
PARSER_ENTRY_NO_DATA("cee-syslog", CEESyslog, 4),
|
||||
PARSER_ENTRY_NO_DATA("mac48", MAC48, 16),
|
||||
PARSER_ENTRY_NO_DATA("cef", CEF, 4),
|
@ -0,0 +1,12 @@
|
||||
diff -up liblognorm-2.0.6/doc/conf.py.orig liblognorm-2.0.6/doc/conf.py
|
||||
--- liblognorm-2.0.6/doc/conf.py.orig 2022-07-19 14:01:01.094313222 +0200
|
||||
+++ liblognorm-2.0.6/doc/conf.py 2022-07-19 14:01:43.454310057 +0200
|
||||
@@ -56,7 +56,7 @@ release = '1.1.2'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
-language = None
|
||||
+language = 'en'
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
@ -0,0 +1,168 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index b6f92f1..752b7d9 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -80,7 +80,7 @@ AC_ARG_ENABLE(regexp,
|
||||
)
|
||||
AM_CONDITIONAL(ENABLE_REGEXP, test x$enable_regexp = xyes)
|
||||
if test "$enable_regexp" = "yes"; then
|
||||
- PKG_CHECK_MODULES(PCRE, libpcre)
|
||||
+ PKG_CHECK_MODULES(PCRE, [libpcre2-8 >= 10.00])
|
||||
AC_DEFINE(FEATURE_REGEXP, 1, [Regular expressions support enabled.])
|
||||
FEATURE_REGEXP=1
|
||||
else
|
||||
@@ -194,5 +194,4 @@ echo "Testbench enabled: $enable_testbench"
|
||||
echo "Valgrind enabled: $enable_valgrind"
|
||||
echo "Debug mode enabled: $enable_debug"
|
||||
echo "Tools enabled: $enable_tools"
|
||||
-echo "Docs enabled: $enable_docs"
|
||||
-
|
||||
+echo "Docs enabled: $enable_docs"
|
||||
\ No newline at end of file
|
||||
diff --git a/src/parser.c b/src/parser.c
|
||||
index 2d70424..dcd5b4e 100644
|
||||
--- a/src/parser.c
|
||||
+++ b/src/parser.c
|
||||
@@ -42,12 +42,6 @@
|
||||
#include "samp.h"
|
||||
#include "helpers.h"
|
||||
|
||||
-#ifdef FEATURE_REGEXP
|
||||
-#include <pcre.h>
|
||||
-#include <errno.h>
|
||||
-#endif
|
||||
-
|
||||
-
|
||||
/* how should output values be formatted? */
|
||||
enum FMT_MODE {
|
||||
FMT_AS_STRING = 0,
|
||||
diff --git a/src/v1_parser.c b/src/v1_parser.c
|
||||
index 323ada0..9fb3ccb 100644
|
||||
--- a/src/v1_parser.c
|
||||
+++ b/src/v1_parser.c
|
||||
@@ -39,7 +39,8 @@
|
||||
#include "v1_samp.h"
|
||||
|
||||
#ifdef FEATURE_REGEXP
|
||||
-#include <pcre.h>
|
||||
+#define PCRE2_CODE_UNIT_WIDTH 8
|
||||
+#include <pcre2.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
@@ -1266,7 +1267,7 @@ void* tokenized_parser_data_constructor(ln_fieldList_t *node, ln_ctx ctx) {
|
||||
* significantly slower than other field-types.
|
||||
*/
|
||||
struct regex_parser_data_s {
|
||||
- pcre *re;
|
||||
+ pcre2_code *re;
|
||||
int consume_group;
|
||||
int return_group;
|
||||
int max_groups;
|
||||
@@ -1276,17 +1277,33 @@ PARSER(Regex)
|
||||
assert(str != NULL);
|
||||
assert(offs != NULL);
|
||||
assert(parsed != NULL);
|
||||
- unsigned int* ovector = NULL;
|
||||
+ PCRE2_SIZE *ovector;
|
||||
+ pcre2_match_data *match_data = NULL;
|
||||
|
||||
struct regex_parser_data_s *pData = (struct regex_parser_data_s*) node->parser_data;
|
||||
if (pData != NULL) {
|
||||
- ovector = calloc(pData->max_groups, sizeof(unsigned int) * 3);
|
||||
- if (ovector == NULL) FAIL(LN_NOMEM);
|
||||
+ match_data = pcre2_match_data_create_from_pattern(pData->re, NULL);
|
||||
+ if (match_data == NULL) FAIL(LN_NOMEM);
|
||||
+
|
||||
+ int result = pcre2_match(
|
||||
+ pData->re, /* the compiled pattern */
|
||||
+ (PCRE2_SPTR)str, /* the subject string */
|
||||
+ (PCRE2_SIZE)strLen, /* the length of the subject */
|
||||
+ (PCRE2_SIZE)*offs, /* start at offset 0 in the subject */
|
||||
+ 0, /* default options */
|
||||
+ match_data, /* block for storing the result */
|
||||
+ NULL); /* use default match context */
|
||||
|
||||
- int result = pcre_exec(pData->re, NULL, str, strLen, *offs, 0, (int*) ovector, pData->max_groups * 3);
|
||||
if (result == 0) result = pData->max_groups;
|
||||
if (result > pData->consume_group) {
|
||||
- /*please check 'man 3 pcreapi' for cryptic '2 * n' and '2 * n + 1' magic*/
|
||||
+ ovector = pcre2_get_ovector_pointer(match_data);
|
||||
+ printf("Match succeeded at offset %d\n", (int)ovector[0]);
|
||||
+
|
||||
+ /* please check 'man 3 pcre2api' for cryptic '2 * n' and '2 * n + 1' magic
|
||||
+ * in a nutshell, within the ovector, the first in each pair of values is set to the
|
||||
+ * offset of the first code unit of a substring, and the second is set to the
|
||||
+ * offset of the first code unit after the end of a substring.
|
||||
+ */
|
||||
if (ovector[2 * pData->consume_group] == *offs) {
|
||||
*parsed = ovector[2 * pData->consume_group + 1] - ovector[2 * pData->consume_group];
|
||||
if (pData->consume_group != pData->return_group) {
|
||||
@@ -1294,22 +1311,20 @@ PARSER(Regex)
|
||||
if((val = strndup(str + ovector[2 * pData->return_group],
|
||||
ovector[2 * pData->return_group + 1] -
|
||||
ovector[2 * pData->return_group])) == NULL) {
|
||||
- free(ovector);
|
||||
FAIL(LN_NOMEM);
|
||||
}
|
||||
*value = json_object_new_string(val);
|
||||
free(val);
|
||||
if (*value == NULL) {
|
||||
- free(ovector);
|
||||
FAIL(LN_NOMEM);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
- free(ovector);
|
||||
}
|
||||
r = 0; /* success */
|
||||
done:
|
||||
+ pcre2_match_data_free(match_data);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -1346,8 +1361,8 @@ void* regex_parser_data_constructor(ln_fieldList_t *node, ln_ctx ctx) {
|
||||
char* name = NULL;
|
||||
struct regex_parser_data_s *pData = NULL;
|
||||
const char *unescaped_exp = NULL;
|
||||
- const char *error = NULL;
|
||||
- int erroffset = 0;
|
||||
+ PCRE2_SIZE erroffset = 0;
|
||||
+ int errcode = 0;
|
||||
|
||||
|
||||
CHKN(name = es_str2cstr(node->name, NULL));
|
||||
@@ -1365,7 +1380,7 @@ void* regex_parser_data_constructor(ln_fieldList_t *node, ln_ctx ctx) {
|
||||
if ((grp_parse_err = regex_parser_configure_consume_and_return_group(args, pData)) != NULL)
|
||||
FAIL(LN_BADCONFIG);
|
||||
|
||||
- CHKN(pData->re = pcre_compile(exp, 0, &error, &erroffset, NULL));
|
||||
+ CHKN(pData->re = pcre2_compile((PCRE2_SPTR)exp, PCRE2_ZERO_TERMINATED, 0, &errcode, &erroffset, NULL));
|
||||
|
||||
pData->max_groups = ((pData->consume_group > pData->return_group) ? pData->consume_group :
|
||||
pData->return_group) + 1;
|
||||
@@ -1387,9 +1402,12 @@ void* regex_parser_data_constructor(ln_fieldList_t *node, ln_ctx ctx) {
|
||||
ln_dbgprintf(ctx, "couldn't allocate memory for regex-string for field: '%s'", name);
|
||||
else if (grp_parse_err != NULL)
|
||||
ln_dbgprintf(ctx, "%s for: '%s'", grp_parse_err, name);
|
||||
- else if (pData->re == NULL)
|
||||
+ else if (pData->re == NULL) {
|
||||
+ PCRE2_UCHAR errbuffer[256];
|
||||
+ pcre2_get_error_message(errcode, errbuffer, sizeof(errbuffer));
|
||||
ln_dbgprintf(ctx, "couldn't compile regex(encountered error '%s' at char '%d' in pattern) "
|
||||
- "for regex-matched field: '%s'", error, erroffset, name);
|
||||
+ "for regex-matched field: '%s'", errbuffer, (int)erroffset, name);
|
||||
+ }
|
||||
regex_parser_data_destructor((void**)&pData);
|
||||
}
|
||||
if (exp != NULL) free(exp);
|
||||
@@ -1401,7 +1419,7 @@ void* regex_parser_data_constructor(ln_fieldList_t *node, ln_ctx ctx) {
|
||||
void regex_parser_data_destructor(void** dataPtr) {
|
||||
if ((*dataPtr) != NULL) {
|
||||
struct regex_parser_data_s *pData = (struct regex_parser_data_s*) *dataPtr;
|
||||
- if (pData->re != NULL) pcre_free(pData->re);
|
||||
+ if (pData->re != NULL) pcre2_code_free(pData->re);
|
||||
free(pData);
|
||||
*dataPtr = NULL;
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
Submitted to Adiscon via ticket system. See:
|
||||
|
||||
<https://bugzilla.redhat.com/show_bug.cgi?id=2141801>
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 759bf0e49cb5d1fa..4b33ab400b380818 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -14231,10 +14231,9 @@ fi
|
||||
# Checks for libraries.
|
||||
save_LIBS=$LIBS
|
||||
LIBS=
|
||||
-as_ac_Search=`$as_echo "ac_cv_search_clock_getm4_defn(2.69)" | $as_tr_sh`
|
||||
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_getm4_defn(2.69)" >&5
|
||||
-$as_echo_n "checking for library containing clock_getm4_defn(2.69)... " >&6; }
|
||||
-if eval \${$as_ac_Search+:} false; then :
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
|
||||
+$as_echo_n "checking for library containing clock_gettime... " >&6; }
|
||||
+if ${ac_cv_search_clock_gettime+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_func_search_save_LIBS=$LIBS
|
||||
@@ -14247,16 +14246,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
-char clock_getm4_defn(2.69) ();
|
||||
+char clock_gettime ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
-return clock_getm4_defn(2.69) ();
|
||||
+return clock_gettime ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
-for ac_lib in '' 2.68time; do
|
||||
+for ac_lib in '' rt; do
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
@@ -14264,29 +14263,28 @@ for ac_lib in '' 2.68time; do
|
||||
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||
fi
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
- eval "$as_ac_Search=\$ac_res"
|
||||
+ ac_cv_search_clock_gettime=$ac_res
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext
|
||||
- if eval \${$as_ac_Search+:} false; then :
|
||||
+ if ${ac_cv_search_clock_gettime+:} false; then :
|
||||
break
|
||||
fi
|
||||
done
|
||||
-if eval \${$as_ac_Search+:} false; then :
|
||||
+if ${ac_cv_search_clock_gettime+:} false; then :
|
||||
|
||||
else
|
||||
- eval "$as_ac_Search=no"
|
||||
+ ac_cv_search_clock_gettime=no
|
||||
fi
|
||||
rm conftest.$ac_ext
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
fi
|
||||
-eval ac_res=\$$as_ac_Search
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
-$as_echo "$ac_res" >&6; }
|
||||
-eval ac_res=\$$as_ac_Search
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
|
||||
+$as_echo "$ac_cv_search_clock_gettime" >&6; }
|
||||
+ac_res=$ac_cv_search_clock_gettime
|
||||
if test "$ac_res" != no; then :
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
- rt
|
||||
+
|
||||
fi
|
||||
|
||||
LIBS=$save_LIBS
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index aad4993f242291a1..b4f791f7cac47a7d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -38,7 +38,7 @@ m4_ifdef([AX_IS_RELEASE], [
|
||||
# Checks for libraries.
|
||||
save_LIBS=$LIBS
|
||||
LIBS=
|
||||
-AC_SEARCH_LIBS(clock_getm4_defn([AC_AUTOCONF_VERSION]), [2.68]time, rt)
|
||||
+AC_SEARCH_LIBS(clock_gettime, rt)
|
||||
LIBS=$save_LIBS
|
||||
|
||||
# Checks for header files.
|
@ -0,0 +1,239 @@
|
||||
%define htmldir %{_docdir}/liblognorm/html
|
||||
|
||||
Name: liblognorm
|
||||
Version: 2.0.6
|
||||
Release: 14%{?dist}
|
||||
Summary: Fast samples-based log normalization library
|
||||
License: LGPL-2.1-or-later AND Apache-2.0
|
||||
URL: http://www.liblognorm.com
|
||||
Source0: http://www.liblognorm.com/files/download/%{name}-%{version}.tar.gz
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: chrpath
|
||||
BuildRequires: libfastjson-devel
|
||||
BuildRequires: libestr-devel
|
||||
BuildRequires: pcre2-devel
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: libtool
|
||||
|
||||
Patch0: liblognorm-2.0.6-rhbz2105934-sphinx5.patch
|
||||
Patch1: liblognorm-configure-glitch.patch
|
||||
Patch2: liblognorm-2.0.6-rhbz2128320.patch
|
||||
Patch3: liblognorm-2.0.0-rhbz1990737-add-skipempty.patch
|
||||
|
||||
%description
|
||||
Briefly described, liblognorm is a tool to normalize log data.
|
||||
|
||||
People who need to take a look at logs often have a common problem. Logs from
|
||||
different machines (from different vendors) usually have different formats for
|
||||
their logs. Even if it is the same type of log (e.g. from firewalls), the log
|
||||
entries are so different, that it is pretty hard to read these. This is where
|
||||
liblognorm comes into the game. With this tool you can normalize all your logs.
|
||||
All you need is liblognorm and its dependencies and a sample database that fits
|
||||
the logs you want to normalize.
|
||||
|
||||
%package devel
|
||||
Summary: Development tools for programs using liblognorm library
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: json-c-devel%{?_isa}
|
||||
Requires: libestr-devel%{?_isa}
|
||||
|
||||
%description devel
|
||||
The liblognorm-devel package includes header files, libraries necessary for
|
||||
developing programs which use liblognorm library.
|
||||
|
||||
%package doc
|
||||
Summary: HTML documentation for liblognorm
|
||||
BuildRequires: python3-sphinx
|
||||
BuildRequires: make
|
||||
|
||||
%description doc
|
||||
This sub-package contains documentation for liblognorm in a HTML form.
|
||||
|
||||
%package utils
|
||||
Summary: Lognormalizer utility for normalizing log files
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description utils
|
||||
The lognormalizer is the core of liblognorm, it is a utility for normalizing
|
||||
log files.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%patch -P 0 -p1 -b .sphinx5
|
||||
%patch -P 1 -p1 -b .configure-glitch
|
||||
%patch -P 2 -p1 -b .pcre2
|
||||
%patch -P 3 -p1
|
||||
|
||||
%build
|
||||
# Prevent rebuild of the configure script.
|
||||
touch configure aclocal.m4 Makefile.in config.h.in
|
||||
autoreconf --verbose --force --install
|
||||
%configure --enable-regexp --enable-docs --docdir=%{htmldir} --includedir=%{_includedir}/%{name}/
|
||||
|
||||
|
||||
%install
|
||||
make V=1 install INSTALL="install -p" DESTDIR=%{buildroot}
|
||||
rm -f %{buildroot}/%{_libdir}/*.{a,la}
|
||||
chrpath -d %{buildroot}%{_bindir}/lognormalizer
|
||||
chrpath -d %{buildroot}%{_libdir}/liblognorm.so
|
||||
rm %{buildroot}%{htmldir}/{objects.inv,.buildinfo}
|
||||
|
||||
%ldconfig_scriptlets
|
||||
|
||||
%files
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
%license COPYING
|
||||
%doc AUTHORS ChangeLog README
|
||||
%exclude %{htmldir}
|
||||
|
||||
%{_libdir}/lib*.so.*
|
||||
|
||||
%files devel
|
||||
%{_libdir}/lib*.so
|
||||
%{_includedir}/%{name}/*.h
|
||||
%{_libdir}/pkgconfig/*.pc
|
||||
|
||||
%files doc
|
||||
%doc %{htmldir}
|
||||
|
||||
%files utils
|
||||
%{_bindir}/lognormalizer
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Aug 06 2024 Attila Lakatos <alakatos@redhat.com> - 2.0.6-14
|
||||
- Allow dropping empty json objects
|
||||
Resolves: RHEL-39979
|
||||
|
||||
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 2.0.6-13
|
||||
- Bump release for June 2024 mass rebuild
|
||||
|
||||
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-12
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Thu Jun 08 2023 Attila Lakatos <alakatos@redhat.com> - 2.0.6-9
|
||||
- Port pcre dependency to pcre2
|
||||
resolves: rhbz#2128320
|
||||
|
||||
* Wed May 31 2023 Attila Lakatos <alakatos@redhat.com> - 2.0.6-8
|
||||
- Update License tag for SPDX
|
||||
- Apache 2.0 was missing according to upstream sources
|
||||
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Thu Nov 17 2022 Florian Weimer <fweimer@redhat.com> - 2.0.6-6
|
||||
- Fix configure.ac/configure glitch (#2141801)
|
||||
|
||||
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Tue Jul 19 2022 Attila Lakatos <alakatos@redhat.com> - 2.0.6-4
|
||||
- Update language to comply with sphinx5
|
||||
resolves: rhbz#2105934
|
||||
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Tue Mar 02 2021 Attila Lakatos <alakatos@redhat.com> - 2.0.6-1
|
||||
- Rebase to 2.0.6
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Thu Oct 12 2017 Marek Tamaskovic <mtamasko@redhat.com> - 2.0.3-4
|
||||
- Fix header files location
|
||||
- resolves rhbz#1113573
|
||||
|
||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Wed Mar 29 2017 Radovan Sroka <rsroka@redhat.com> - 2.0.2-1
|
||||
- rebase to 2.0.3
|
||||
|
||||
* Thu Feb 9 2017 Radovan Sroka <rsroka@redhat.com> - 2.0.2-2
|
||||
- removed forgoten commented line
|
||||
|
||||
* Thu Feb 9 2017 Radovan Sroka <rsroka@redhat.com> - 2.0.2-1
|
||||
- rebase to 2.0.2
|
||||
|
||||
* Tue Oct 4 2016 Radovan Sroka <rsroka@redhat.com> - 2.0.1-1
|
||||
- rebase to 2.0.1
|
||||
|
||||
* Tue Mar 15 2016 Radovan Sroka <rsroka@redhat.com> - 1.1.3-1
|
||||
- rebase to v1.1.3
|
||||
|
||||
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Sun Mar 15 2015 Tomas Heinrich <theinric@redhat.com> - 1.1.1-1
|
||||
- rebase to 1.1.1 (soname bump)
|
||||
- drop liblognorm-0.3.4-pc-file.patch, not needed anymore
|
||||
- update dependencies for the new version
|
||||
- add a new subpackage for documentation
|
||||
- enable support for reqular expressions
|
||||
- make build more verbose
|
||||
|
||||
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.7-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.7-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Wed Jul 31 2013 Tomas Heinrich <theinric@redhat.com> - 0.3.7-1
|
||||
- rebase to 0.3.7
|
||||
|
||||
* Wed Dec 12 2012 Mahaveer Darade <mah.darade@gmail.com> - 0.3.5-1
|
||||
- upgrade to upstream version 0.3.5
|
||||
- drop patch0, merged upstream
|
||||
liblognorm-0.3.4-rename-to-lognormalizer.patch
|
||||
- remove trailing whitespace
|
||||
|
||||
* Fri Oct 05 2012 mdarade <mdarade@redhat.com> - 0.3.4-4
|
||||
- Modified description of main & util package
|
||||
|
||||
* Thu Sep 20 2012 Mahaveer Darade <mdarade@redhat.com> - 0.3.4-3
|
||||
- Renamed normalizer binary to lognormalizer
|
||||
- Updated pc file to exclude lee and lestr
|
||||
|
||||
* Mon Aug 27 2012 mdarade <mdarade@redhat.com> - 0.3.4-2
|
||||
- Updated BuildRequires to contain libestr-devel
|
||||
|
||||
* Wed Aug 1 2012 Milan Bartos <mbartos@redhat.com> - 0.3.4-1
|
||||
- initial port
|
Loading…
Reference in new issue