Lowercase all hostnames before sending to the database.
This commit is contained in:
parent
68f253d460
commit
d3e020362c
1 changed files with 3 additions and 3 deletions
|
|
@ -44,7 +44,7 @@ import
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
VERSION = "v0.1.0"
|
VERSION = "v0.1.1"
|
||||||
USAGE = """
|
USAGE = """
|
||||||
./netdata_tsrelay [-q][-v][-h] --dbopts="[PostgreSQL connection string]" --listen-port=14866 --listen-addr=0.0.0.0
|
./netdata_tsrelay [-q][-v][-h] --dbopts="[PostgreSQL connection string]" --listen-port=14866 --listen-addr=0.0.0.0
|
||||||
|
|
||||||
|
|
@ -160,7 +160,7 @@ proc write_to_database( samples: seq[ JsonNode ] ): void =
|
||||||
for sample in samples:
|
for sample in samples:
|
||||||
var
|
var
|
||||||
timestamp = sample[ "timestamp" ].get_num
|
timestamp = sample[ "timestamp" ].get_num
|
||||||
host = sample[ "hostname" ].get_str
|
host = sample[ "hostname" ].get_str.to_lowerascii
|
||||||
sample.delete( "timestamp" )
|
sample.delete( "timestamp" )
|
||||||
sample.delete( "hostname" )
|
sample.delete( "hostname" )
|
||||||
db.exec sql( conf.insertsql ), timestamp, host, sample
|
db.exec sql( conf.insertsql ), timestamp, host, sample
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue