diff --git a/src/output-json.c b/src/output-json.c index 7661725d52..3a24fcecfb 100644 --- a/src/output-json.c +++ b/src/output-json.c @@ -435,7 +435,17 @@ OutputCtx *OutputJsonInitCtx(ConfNode *conf) { OutputJsonCtx *json_ctx = SCCalloc(1, sizeof(OutputJsonCtx));; + /* First lookup a sensor-name value in this outputs configuration + * node (deprecated). If that fails, lookup the global one. */ const char *sensor_name = ConfNodeLookupChildValue(conf, "sensor-name"); + if (sensor_name != NULL) { + SCLogWarning(SC_ERR_DEPRECATED_CONF, + "Found deprecated eve-log setting \"sensor-name\". " + "Please set sensor-name globally."); + } + else { + ConfGet("sensor-name", (char **)&sensor_name); + } if (unlikely(json_ctx == NULL)) { SCLogDebug("AlertJsonInitCtx: Could not create new LogFileCtx"); diff --git a/src/util-error.c b/src/util-error.c index 8ea229b598..5b03c5ad15 100644 --- a/src/util-error.c +++ b/src/util-error.c @@ -314,6 +314,7 @@ const char * SCErrorToString(SCError err) CASE_CODE (SC_ERR_INVALID_RULE_ARGUMENT); CASE_CODE (SC_ERR_STATS_LOG_NEGATED); CASE_CODE (SC_ERR_JSON_STATS_LOG_NEGATED); + CASE_CODE (SC_ERR_DEPRECATED_CONF); } return "UNKNOWN_ERROR"; diff --git a/src/util-error.h b/src/util-error.h index fec09d04a7..0dcfb674d1 100644 --- a/src/util-error.h +++ b/src/util-error.h @@ -304,6 +304,7 @@ typedef enum { SC_ERR_MT_NO_MAPPING, SC_ERR_STATS_LOG_NEGATED, /** When totals and threads are both NO in yaml **/ SC_ERR_JSON_STATS_LOG_NEGATED, /** When totals and threads are both NO in yaml **/ + SC_ERR_DEPRECATED_CONF, /**< Deprecated configuration parameter. */ } SCError; const char *SCErrorToString(SCError);