in src/main/java/com/aliyun/openservices/log/sample/LogtailConfigSample.java [144:193]
public void GetConfig() {
try {
GetConfigResponse res = client.GetConfig(project, testConfigName);
System.out.println("RequestId:" + res.GetRequestId());
Config config = res.GetConfig();
System.out.println("ConfigName:" + config.GetConfigName());
//Optional get inputDetail by json object
//JSONObject inputDetail = ((ConfigInputDetail)(res.GetConfig().GetInputDetail())).ToJson();
System.out.println("logType:" + ((ConfigInputDetail) res.GetConfig().GetInputDetail()).GetLogType());
System.out.println("logPath:" + ((ConfigInputDetail) (res.GetConfig().GetInputDetail())).GetLogPath());
System.out.println("filePattern:" + ((ConfigInputDetail) (res.GetConfig().GetInputDetail())).GetFilePattern());
System.out.println("localStorage:" + res.GetConfig().GetInputDetail().GetLocalStorage());
System.out.println("timeFormat:" + ((ConfigInputDetail) (res.GetConfig().GetInputDetail())).GetTimeFormat());
System.out.println("logBeginRegex:" + ((ConfigInputDetail) (res.GetConfig().GetInputDetail())).GetLogBeginRegex());
System.out.println("regex:" + ((ConfigInputDetail) (res.GetConfig().GetInputDetail())).GetRegex());
System.out.println("topicFormat:" + ((ConfigInputDetail) (res.GetConfig().GetInputDetail())).GetTopicFormat());
List<String> keyRes = ((ConfigInputDetail) (res.GetConfig().GetInputDetail())).GetKey();
System.out.println("key");
for (String key : keyRes) {
System.out.println(key);
}
List<String> filterKeyRes = res.GetConfig().GetInputDetail().GetFilterKey();
System.out.println("filterKey");
for (String filterKey : filterKeyRes) {
System.out.println(filterKey);
}
List<String> filterRegexRes = res.GetConfig().GetInputDetail().GetFilterRegex();
System.out.println("filterRegex");
for (String filterRegex : filterRegexRes) {
System.out.println(filterRegex);
}
//Optional get outputDetail by json object
//JSONObject outputDetail = res.GetConfig().GetOutputDetail().ToJson();
System.out.println("OutputDetail Endpoint:" + config.GetOutputDetail().GetEndpoint());
System.out.println("OutputDetail LogStoreName:" + config.GetOutputDetail().GetLogstoreName());
//System.out.println("CreateTime:" + config.GetCreateTime());
//System.out.println("LastModifyTime:" + config.GetLastModifyTime());
} catch (LogException e) {
e.printStackTrace();
}
}