@@ -124,6 +124,7 @@ func NewReader(meta *reader.Meta, conf conf.MapConf) (reader.Reader, error) {
124
124
keepAlive , _ := conf .GetStringOr (KeyESKeepAlive , "6h" )
125
125
cronSched , _ := conf .GetStringOr (KeyESCron , "" )
126
126
execOnStart , _ := conf .GetBoolOr (KeyESExecOnstart , true )
127
+ sniff , _ := conf .GetBoolOr (KeyESSniff , false )
127
128
offsetKey , _ := conf .GetStringOr (KeyESOffsetKey , "" )
128
129
offsetKeyType , _ := conf .GetStringOr (KeyESOffsetKeyType , "" )
129
130
startTime , _ := conf .GetStringOr (KeyESOffsetStartTime , "" )
@@ -153,6 +154,7 @@ func NewReader(meta *reader.Meta, conf conf.MapConf) (reader.Reader, error) {
153
154
optFns := []elasticV7.ClientOptionFunc {
154
155
elasticV7 .SetHealthcheck (false ),
155
156
elasticV7 .SetURL (eshost ),
157
+ elasticV7 .SetSniff (sniff ),
156
158
}
157
159
158
160
if len (authUsername ) > 0 && len (authPassword ) > 0 {
@@ -167,6 +169,7 @@ func NewReader(meta *reader.Meta, conf conf.MapConf) (reader.Reader, error) {
167
169
optFns := []elasticV6.ClientOptionFunc {
168
170
elasticV6 .SetHealthcheck (false ),
169
171
elasticV6 .SetURL (eshost ),
172
+ elasticV6 .SetSniff (sniff ),
170
173
}
171
174
172
175
if len (authUsername ) > 0 && len (authPassword ) > 0 {
@@ -179,7 +182,7 @@ func NewReader(meta *reader.Meta, conf conf.MapConf) (reader.Reader, error) {
179
182
}
180
183
case ElasticVersion3 :
181
184
optFns := []elasticV3.ClientOptionFunc {
182
- elasticV3 .SetSniff (false ),
185
+ elasticV3 .SetSniff (sniff ),
183
186
elasticV3 .SetHealthcheck (false ),
184
187
elasticV3 .SetURL (eshost ),
185
188
}
0 commit comments