comparison src/wflogs-config.h @ 4:37eace15ef87

allow hourly/daily/weekly triggers for output generation, append to temp wflogs input files so daemon restart won't drop as much data
author Carl Byington <carl@five-ten-sg.com>
date Fri, 17 May 2013 12:03:21 -0700
parents 400b1de6e1c6
children 306059d0f677
comparison
equal deleted inserted replaced
3:2ea606326f5b 4:37eace15ef87
29 int len; // bytes in the buffer 29 int len; // bytes in the buffer
30 char buf[buflen]; 30 char buf[buflen];
31 // output side 31 // output side
32 int fdo; // output tempin wflogs file 32 int fdo; // output tempin wflogs file
33 time_t open_time; // time when fdo opened 33 time_t open_time; // time when fdo opened
34 tm open_tm;
34 TOKEN *tokp; 35 TOKEN *tokp;
35 // our data 36 // our data
36 int period; // in seconds 37 int period; // in seconds
37 int versions; // number to keep 38 int versions; // number to keep
38 // all strings owned by the string table 39 // all strings owned by the string table
40 const char * trigger; // trigger token or NULL
39 const char * output; // output file name pattern 41 const char * output; // output file name pattern
40 const char * tempin; // temp wflogs input file name 42 const char * tempin; // temp wflogs input file name
41 const char * wflogs; // wflogs command line 43 const char * wflogs; // wflogs command line
42 const char * fn; // name of the syslog file 44 const char * fn; // name of the syslog file
43 const char * pattern; // regex to filter lines 45 const char * pattern; // regex to filter lines
61 bool write(char *p); 63 bool write(char *p);
62 bool read(); 64 bool read();
63 void closeo(); 65 void closeo();
64 void close(); 66 void close();
65 void process(char *p); 67 void process(char *p);
66 void check_wflog(); // time to call it? 68 bool check_wflog_time();
69 void check_wflog();
67 void free_all(); 70 void free_all();
68 }; 71 };
69 typedef CONTEXT * CONTEXTP; 72 typedef CONTEXT * CONTEXTP;
70 typedef list<CONTEXTP> context_list; 73 typedef list<CONTEXTP> context_list;
71 74
96 bool load_conf(CONFIG &dc, const char *fn); 99 bool load_conf(CONFIG &dc, const char *fn);
97 void token_init(); 100 void token_init();
98 101
99 102
100 extern const char *token_context; 103 extern const char *token_context;
104 extern const char *token_daily;
101 extern const char *token_file; 105 extern const char *token_file;
106 extern const char *token_hourly;
102 extern const char *token_include; 107 extern const char *token_include;
103 extern const char *token_lbrace; 108 extern const char *token_lbrace;
104 extern const char *token_output; 109 extern const char *token_output;
105 extern const char *token_pattern; 110 extern const char *token_pattern;
106 extern const char *token_period; 111 extern const char *token_period;
107 extern const char *token_rbrace; 112 extern const char *token_rbrace;
108 extern const char *token_semi; 113 extern const char *token_semi;
109 extern const char *token_tempin; 114 extern const char *token_tempin;
115 extern const char *token_trigger;
110 extern const char *token_versions; 116 extern const char *token_versions;
117 extern const char *token_weekly;
111 extern const char *token_wflogs; 118 extern const char *token_wflogs;