Skip to content

Commit

Permalink
v6.3.1 功能改进
Browse files Browse the repository at this point in the history
1. elasticsearch rest client改进:使用params中的参数变量,解析配置文件中dslName对应的dsl语句,并返回解析结果

```java
        ClientInterface util = (ConfigRestClientUtil) ElasticSearchHelper.getConfigRestClientUtil("demo7.xml");
		Map params = new HashMap();
		params.put("aaa","_&/+\"\\.");
		System.out.println(util.evalConfigDsl("testesencode",params));
```
2. 数据同步工具改进:
  日志采集探针,字符串maxBytes为0或者负数时忽略长度截取

  日志采集探针,增加忽略条件匹配类型:文件记录包含与排除条件匹配类型
  REGEX_MATCH("REGEX_MATCH"),REGEX_CONTAIN("REGEX_CONTAIN"),STRING_CONTAIN("STRING_CONTAIN"),
  	STRING_EQUALS("STRING_EQUALS"),STRING_PREFIX("STRING_PREFIX"),STRING_END("STRING_END");
  	使用案例:
```java
  				config.addConfig(new FileConfig(logPath,//指定目录
    							fileName+".log",//指定文件名称,可以是正则表达式
    							startLabel)//指定多行记录的开头识别标记,正则表达式
    							.setCloseEOF(false)//已经结束的文件内容采集完毕后关闭文件对应的采集通道,后续不再监听对应文件的内容变化
    							.addField("tag",fileName.toLowerCase())//添加字段tag到记录中
    							.setEnableInode(true)
    							.setIncludeLines(levelArr, LineMatchType.STRING_CONTAIN)
```
3. 数据同步工具改进:默认采用异步机制保存增量同步数据状态,提升数据同步效率,可以通过以下机制关闭异步机制:
importBuilder.setAsynFlushStatus(false);

4. 客户端改进:增加dsl输出组件logDslCallback
通过组件logDslCallback,通过回调接口方法可以自定义采集dsl的执行信息:
  • Loading branch information
yin-bp committed Aug 1, 2021
1 parent 0617366 commit ad99e3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ protected int initStatus(HttpResponse response){
public void setUrl(String url) {
this.url = url;
}

public String getUrl() {
return url;
}

protected RuntimeException throwException(int status, HttpEntity entity) throws IOException {

if (entity != null ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
*/
public interface URLResponseHandler<T> extends ResponseHandler<T> {
public void setUrl(String url);
public String getUrl();
}

0 comments on commit ad99e3b

Please sign in to comment.