Added AAAA_QUERY_ANALYSIS config flag for skiping the analysis of AAAA records
This commit is contained in:
parent
7adae527b5
commit
81db618568
1
FTL.h
1
FTL.h
|
@ -111,6 +111,7 @@ typedef struct {
|
|||
bool include_yesterday;
|
||||
bool rolling_24h;
|
||||
bool query_display;
|
||||
bool analyze_AAAA;
|
||||
} ConfigStruct;
|
||||
|
||||
// Dynamic structs
|
||||
|
|
|
@ -102,6 +102,7 @@ Possible settings (the first one is the default setting):
|
|||
- `SOCKET_LISTENING=localonly|all` (listen only for local connections or permit all connections)
|
||||
- `TIMEFRAME=rolling24h|yesterday|today` (rolling data window, up to 48h (today + yesterday), or up to 24h (only today, as in Pi-hole `v2.x` ))
|
||||
- `QUERY_DISPLAY=yes|no` (hide queries altogether)
|
||||
- `analyze_AAAA=yes|no` (do we want `FTL` to analyze AAAA queries from pihole.log?)
|
||||
|
||||
### Implemented keywords (starting with `>`, subject to change):
|
||||
|
||||
|
|
14
config.c
14
config.c
|
@ -81,6 +81,20 @@ void read_FTLconf(void)
|
|||
else
|
||||
logg(" QUERY_DISPLAY: Hide queries");
|
||||
|
||||
// AAAA_QUERY_ANALYSIS
|
||||
// defaults to: Yes
|
||||
config.analyze_AAAA = true;
|
||||
buffer = parse_FTLconf(fp, "AAAA_QUERY_ANALYSIS");
|
||||
if(buffer != NULL)
|
||||
{
|
||||
if(strcmp(buffer, "no") == 0)
|
||||
config.analyze_AAAA = false;
|
||||
}
|
||||
if(config.analyze_AAAA)
|
||||
logg(" AAAA_QUERY_ANALYSIS: Show AAAA queries");
|
||||
else
|
||||
logg(" AAAA_QUERY_ANALYSIS: Hide AAAA queries");
|
||||
|
||||
logg("Finished config file parsing");
|
||||
|
||||
if(conflinebuffer != NULL)
|
||||
|
|
6
parser.c
6
parser.c
|
@ -198,6 +198,12 @@ void process_pihole_log(int file)
|
|||
continue;
|
||||
}
|
||||
|
||||
if(!config.analyze_AAAA && strstr(readbuffer,"]: query[AAAA]") != NULL)
|
||||
{
|
||||
if(debug) logg("Not analyzing AAAA query");
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get timestamp
|
||||
int querytimestamp, overTimetimestamp;
|
||||
extracttimestamp(readbuffer, &querytimestamp, &overTimetimestamp);
|
||||
|
|
Loading…
Reference in New Issue