new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / analysisd / output / jsonout.c
1 /* Copyright (C) 2015 Trend Micro Inc.
2  * All rights reserved.
3  *
4  * This program is a free software; you can redistribute it
5  * and/or modify it under the terms of the GNU General Public
6  * License (version 2) as published by the FSF - Free Software
7  * Foundation.
8  */
9
10 #include "jsonout.h"
11 #include "alerts/getloglocation.h"
12 #include "format/to_json.h"
13
14 void jsonout_output_event(const Eventinfo *lf)
15 {
16     char *json_alert = Eventinfo_to_jsonstr(lf);
17
18     fprintf(_jflog,
19             "%s\n",
20             json_alert);
21
22     fflush(_jflog);
23     free(json_alert);
24     return;
25 }
26 void jsonout_output_archive(const Eventinfo *lf)
27 {
28     char *json_alert = Archiveinfo_to_jsonstr(lf);
29
30     fprintf(_ejflog,
31             "%s\n",
32             json_alert);
33
34     fflush(_ejflog);
35     free(json_alert);
36     return;
37 }