@@ -124,6 +124,7 @@ func NewReader(meta *reader.Meta, conf conf.MapConf) (reader.Reader, error) {
124124 keepAlive , _ := conf .GetStringOr (KeyESKeepAlive , "6h" )
125125 cronSched , _ := conf .GetStringOr (KeyESCron , "" )
126126 execOnStart , _ := conf .GetBoolOr (KeyESExecOnstart , true )
127+ sniff , _ := conf .GetBoolOr (KeyESSniff , false )
127128 offsetKey , _ := conf .GetStringOr (KeyESOffsetKey , "" )
128129 offsetKeyType , _ := conf .GetStringOr (KeyESOffsetKeyType , "" )
129130 startTime , _ := conf .GetStringOr (KeyESOffsetStartTime , "" )
@@ -153,6 +154,7 @@ func NewReader(meta *reader.Meta, conf conf.MapConf) (reader.Reader, error) {
153154 optFns := []elasticV7.ClientOptionFunc {
154155 elasticV7 .SetHealthcheck (false ),
155156 elasticV7 .SetURL (eshost ),
157+ elasticV7 .SetSniff (sniff ),
156158 }
157159
158160 if len (authUsername ) > 0 && len (authPassword ) > 0 {
@@ -167,6 +169,7 @@ func NewReader(meta *reader.Meta, conf conf.MapConf) (reader.Reader, error) {
167169 optFns := []elasticV6.ClientOptionFunc {
168170 elasticV6 .SetHealthcheck (false ),
169171 elasticV6 .SetURL (eshost ),
172+ elasticV6 .SetSniff (sniff ),
170173 }
171174
172175 if len (authUsername ) > 0 && len (authPassword ) > 0 {
@@ -179,7 +182,7 @@ func NewReader(meta *reader.Meta, conf conf.MapConf) (reader.Reader, error) {
179182 }
180183 case ElasticVersion3 :
181184 optFns := []elasticV3.ClientOptionFunc {
182- elasticV3 .SetSniff (false ),
185+ elasticV3 .SetSniff (sniff ),
183186 elasticV3 .SetHealthcheck (false ),
184187 elasticV3 .SetURL (eshost ),
185188 }
0 commit comments