Skip to content

feature: support ingest processor #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Field Specifications:
<dependency>
<groupId>com.aliyun.openservices</groupId>
<artifactId>aliyun-log-log4j-appender</artifactId>
<version>0.1.12</version>
<version>0.1.16</version>
</dependency>
```

Expand Down Expand Up @@ -113,6 +113,9 @@ log4j.appender.loghub.timeFormat = yyyy-MM-dd'T'HH:mm:ssZ

# Specify timezone of the field time, default is UTC, optional
log4j.appender.loghub.timeZone = UTC

# Specify ingest processor, default is "", optional
log4j.appender.loghub.processor=[ingest processor]
```

## Sample Code
Expand Down
5 changes: 4 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ __topic__: yyy
<dependency>
<groupId>com.aliyun.openservices</groupId>
<artifactId>aliyun-log-log4j-appender</artifactId>
<version>0.1.12</version>
<version>0.1.16</version>
</dependency>
```

Expand Down Expand Up @@ -116,6 +116,9 @@ log4j.appender.loghub.source = [your source]
log4j.appender.loghub.timeFormat=yyyy-MM-dd'T'HH:mm:ssZ
#设置时区,默认为 UTC,可选参数(如果希望 time 字段的时区为东八区,可将该值设定为 Asia/Shanghai)
log4j.appender.loghub.timeZone=UTC

#设置写入处理器,默认为 "",可选参数
log4j.appender.loghub.processor=[ingest processor]
```
参阅:https://github.com/aliyun/aliyun-log-producer-java

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>com.aliyun.openservices</groupId>
<artifactId>aliyun-log-log4j-appender</artifactId>
<version>0.1.15</version>
<version>0.1.16</version>

<name>aliyun log log4j appender</name>
<url>http://www.aliyun.com</url>
Expand Down Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>com.aliyun.openservices</groupId>
<artifactId>aliyun-log-producer</artifactId>
<version>0.3.18</version>
<version>0.3.23</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public class LoghubAppender extends AppenderSkeleton {

private DateTimeFormatter formatter;

private String processor;

@Override
public void activateOptions() {
super.activateOptions();
Expand Down Expand Up @@ -322,4 +324,13 @@ public String getTimeZone() {
public void setTimeZone(String timeZone) {
this.timeZone = timeZone;
}

public String getProcessor() {
return processor;
}

public void setProcessor(String processor) {
this.processor = processor;
producerConfig.setProcessor(processor);
}
}