X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fanalysisd%2Foutput%2Fjsonout.c;fp=src%2Fanalysisd%2Foutput%2Fjsonout.c;h=237be3d02de3501c39bf12db47505359a87206b0;hp=0000000000000000000000000000000000000000;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hpb=927951d1c1ad45ba9e7325f07d996154a91c911b diff --git a/src/analysisd/output/jsonout.c b/src/analysisd/output/jsonout.c new file mode 100644 index 0000000..237be3d --- /dev/null +++ b/src/analysisd/output/jsonout.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2015 Trend Micro Inc. + * All rights reserved. + * + * This program is a free software; you can redistribute it + * and/or modify it under the terms of the GNU General Public + * License (version 2) as published by the FSF - Free Software + * Foundation. + */ + +#include "jsonout.h" +#include "alerts/getloglocation.h" +#include "format/to_json.h" + +void jsonout_output_event(const Eventinfo *lf) +{ + char *json_alert = Eventinfo_to_jsonstr(lf); + + fprintf(_jflog, + "%s\n", + json_alert); + + fflush(_jflog); + free(json_alert); + return; +} +void jsonout_output_archive(const Eventinfo *lf) +{ + char *json_alert = Archiveinfo_to_jsonstr(lf); + + fprintf(_ejflog, + "%s\n", + json_alert); + + fflush(_ejflog); + free(json_alert); + return; +}