66 "net/url"
77 "os"
88 "path/filepath"
9+ "regexp"
910 "runtime"
1011 "strings"
1112 "sync"
@@ -192,6 +193,8 @@ func (app *App) Start() (err error) {
192193
193194 app .writeChan = make (chan * RowBinary.WriteBuffer )
194195
196+ validationRegex := regexp .MustCompile (app .Config .Common .ValidationRegex )
197+
195198 /* WRITER start */
196199 uploaders := make ([]string , 0 , len (conf .Upload ))
197200 for t := range conf .Upload {
@@ -256,6 +259,7 @@ func (app *App) Start() (err error) {
256259 receiver .DropPast (uint32 (conf .Tcp .DropPast .Value ().Seconds ())),
257260 receiver .DropLongerThan (conf .Tcp .DropLongerThan ),
258261 receiver .ReadTimeout (uint32 (conf .Tcp .ReadTimeout .Value ().Seconds ())),
262+ receiver .ValidationRegex (validationRegex ),
259263 )
260264
261265 if err != nil {
@@ -274,6 +278,7 @@ func (app *App) Start() (err error) {
274278 receiver .DropFuture (uint32 (conf .Udp .DropFuture .Value ().Seconds ())),
275279 receiver .DropPast (uint32 (conf .Udp .DropPast .Value ().Seconds ())),
276280 receiver .DropLongerThan (conf .Udp .DropLongerThan ),
281+ receiver .ValidationRegex (validationRegex ),
277282 )
278283
279284 if err != nil {
@@ -292,6 +297,7 @@ func (app *App) Start() (err error) {
292297 receiver .DropFuture (uint32 (conf .Pickle .DropFuture .Value ().Seconds ())),
293298 receiver .DropPast (uint32 (conf .Pickle .DropPast .Value ().Seconds ())),
294299 receiver .DropLongerThan (conf .Pickle .DropLongerThan ),
300+ receiver .ValidationRegex (validationRegex ),
295301 )
296302
297303 if err != nil {
@@ -309,6 +315,7 @@ func (app *App) Start() (err error) {
309315 receiver .DropFuture (uint32 (conf .Grpc .DropFuture .Value ().Seconds ())),
310316 receiver .DropPast (uint32 (conf .Grpc .DropPast .Value ().Seconds ())),
311317 receiver .DropLongerThan (conf .Grpc .DropLongerThan ),
318+ receiver .ValidationRegex (validationRegex ),
312319 )
313320
314321 if err != nil {
@@ -326,6 +333,7 @@ func (app *App) Start() (err error) {
326333 receiver .DropFuture (uint32 (conf .Prometheus .DropFuture .Value ().Seconds ())),
327334 receiver .DropPast (uint32 (conf .Prometheus .DropPast .Value ().Seconds ())),
328335 receiver .DropLongerThan (conf .Prometheus .DropLongerThan ),
336+ receiver .ValidationRegex (validationRegex ),
329337 )
330338
331339 if err != nil {
@@ -344,6 +352,7 @@ func (app *App) Start() (err error) {
344352 receiver .DropPast (uint32 (conf .TelegrafHttpJson .DropPast .Value ().Seconds ())),
345353 receiver .DropLongerThan (conf .TelegrafHttpJson .DropLongerThan ),
346354 receiver .ConcatChar (conf .TelegrafHttpJson .Concat ),
355+ receiver .ValidationRegex (validationRegex ),
347356 )
348357
349358 if err != nil {
0 commit comments