Querylog -- Omit empty fields when writing json
This commit is contained in:
parent
a63fe958ae
commit
dc1042c3e9
|
@ -30,7 +30,7 @@ var (
|
||||||
|
|
||||||
type logEntry struct {
|
type logEntry struct {
|
||||||
Question []byte
|
Question []byte
|
||||||
Answer []byte
|
Answer []byte `json:",omitempty"` // sometimes empty answers happen like binerdunt.top or rev2.globalrootservers.net
|
||||||
Result dnsfilter.Result
|
Result dnsfilter.Result
|
||||||
Time time.Time
|
Time time.Time
|
||||||
Elapsed time.Duration
|
Elapsed time.Duration
|
||||||
|
|
|
@ -136,9 +136,9 @@ var (
|
||||||
|
|
||||||
// Result holds state of hostname check
|
// Result holds state of hostname check
|
||||||
type Result struct {
|
type Result struct {
|
||||||
IsFiltered bool
|
IsFiltered bool `json:",omitempty"`
|
||||||
Reason Reason
|
Reason Reason `json:",omitempty"`
|
||||||
Rule string
|
Rule string `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Matched can be used to see if any match at all was found, no matter filtered or not
|
// Matched can be used to see if any match at all was found, no matter filtered or not
|
||||||
|
|
Loading…
Reference in New Issue