Added AAAA_QUERY_ANALYSIS config flag for skiping the analysis of AAAA records

This commit is contained in:
DL6ER 2017-06-01 23:09:11 +02:00
parent 7adae527b5
commit 81db618568
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD
4 changed files with 22 additions and 0 deletions

1
FTL.h
View File

@ -111,6 +111,7 @@ typedef struct {
bool include_yesterday;
bool rolling_24h;
bool query_display;
bool analyze_AAAA;
} ConfigStruct;
// Dynamic structs

View File

@ -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):

View File

@ -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)

View File

@ -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);