public class AppRulesSpec extends Object
| Constructor and Description |
|---|
AppRulesSpec() |
| Modifier and Type | Method and Description |
|---|---|
AppRulesSpec |
addAttrListItem(String attrListItem) |
AppRulesSpec |
addDiscoveryRuleItem(DiscoveryRule discoveryRuleItem) |
AppRulesSpec |
addLogFileFixItem(String logFileFixItem) |
AppRulesSpec |
addLogPathRuleItem(LogPathRule logPathRuleItem) |
boolean |
equals(Object o) |
String |
getAppType()
服务类型,用于标记服务的分类,仅用于规则分类和界面展示。可以填写任意字段,如按技术栈分类可填写Java,Python。按作用分类可填写collector(采集),database(数据库)等。
|
List<String> |
getAttrList()
属性列表(暂不使用,可不传)。 cmdLine、env
|
String |
getDetectLog()
是否开启日志采集。 true、false
|
List<DiscoveryRule> |
getDiscoveryRule()
规则发现部分,数组中有多个对象时表示需要同时满足所有条件的进程才会被匹配到。 checkType为cmdLine时checkMode填contain,checkContent格式为[“xxx”]表示进程命令行参数中需要包含xxx。checkType为env时checkMode填contain,checkContent格式为 [\"k1\",\"v1\"]表示进程环境变量中需要包含名为k1值为v1的环境变量。checkType为scope时checkMode填equals,checkContent格式为节点ID数组[\"hostId1”,”hostId2”],表示规则仅会在这些节点上生效(如果不指定节点范围,规则将下发到该项目所有的节点)。
|
String |
getIsDefaultRule()
是否为默认规则。 true、false
|
String |
getIsDetect()
是否为规则预探测场景(预探测场景不会保存规则,仅用于规则下发之前验证该规则能否有效发现节点上的进程)。 true、false
|
List<String> |
getLogFileFix()
日志文件的后缀。 log、trace、out
|
List<LogPathRule> |
getLogPathRule()
日志路径配置规则。 当cmdLineHash为固定字符串时,指定日志路径或者日志文件。否则只采集进程当前打开的以.log和.trace结尾的文件。nameType取值cmdLineHash时,args格式为[\"00001\"],value格式为[\"/xxx/xx.log\"],表示当启动命令是00001时,日志路径为/xxx/xx.log。
|
NameRule |
getNameRule()
Get nameRule
|
Integer |
getPriority()
规则优先级。 1~9999的整数字符串,默认取值为9999
|
int |
hashCode() |
void |
setAppType(String appType) |
void |
setAttrList(List<String> attrList) |
void |
setDetectLog(String detectLog) |
void |
setDiscoveryRule(List<DiscoveryRule> discoveryRule) |
void |
setIsDefaultRule(String isDefaultRule) |
void |
setIsDetect(String isDetect) |
void |
setLogFileFix(List<String> logFileFix) |
void |
setLogPathRule(List<LogPathRule> logPathRule) |
void |
setNameRule(NameRule nameRule) |
void |
setPriority(Integer priority) |
String |
toString() |
AppRulesSpec |
withAppType(String appType) |
AppRulesSpec |
withAttrList(java.util.function.Consumer<List<String>> attrListSetter) |
AppRulesSpec |
withAttrList(List<String> attrList) |
AppRulesSpec |
withDetectLog(String detectLog) |
AppRulesSpec |
withDiscoveryRule(java.util.function.Consumer<List<DiscoveryRule>> discoveryRuleSetter) |
AppRulesSpec |
withDiscoveryRule(List<DiscoveryRule> discoveryRule) |
AppRulesSpec |
withIsDefaultRule(String isDefaultRule) |
AppRulesSpec |
withIsDetect(String isDetect) |
AppRulesSpec |
withLogFileFix(java.util.function.Consumer<List<String>> logFileFixSetter) |
AppRulesSpec |
withLogFileFix(List<String> logFileFix) |
AppRulesSpec |
withLogPathRule(java.util.function.Consumer<List<LogPathRule>> logPathRuleSetter) |
AppRulesSpec |
withLogPathRule(List<LogPathRule> logPathRule) |
AppRulesSpec |
withNameRule(java.util.function.Consumer<NameRule> nameRuleSetter) |
AppRulesSpec |
withNameRule(NameRule nameRule) |
AppRulesSpec |
withPriority(Integer priority) |
public AppRulesSpec withAppType(String appType)
public String getAppType()
public void setAppType(String appType)
public AppRulesSpec withAttrList(List<String> attrList)
public AppRulesSpec addAttrListItem(String attrListItem)
public AppRulesSpec withAttrList(java.util.function.Consumer<List<String>> attrListSetter)
public AppRulesSpec withDetectLog(String detectLog)
public String getDetectLog()
public void setDetectLog(String detectLog)
public AppRulesSpec withDiscoveryRule(List<DiscoveryRule> discoveryRule)
public AppRulesSpec addDiscoveryRuleItem(DiscoveryRule discoveryRuleItem)
public AppRulesSpec withDiscoveryRule(java.util.function.Consumer<List<DiscoveryRule>> discoveryRuleSetter)
public List<DiscoveryRule> getDiscoveryRule()
public void setDiscoveryRule(List<DiscoveryRule> discoveryRule)
public AppRulesSpec withIsDefaultRule(String isDefaultRule)
public String getIsDefaultRule()
public void setIsDefaultRule(String isDefaultRule)
public AppRulesSpec withIsDetect(String isDetect)
public String getIsDetect()
public void setIsDetect(String isDetect)
public AppRulesSpec withLogFileFix(List<String> logFileFix)
public AppRulesSpec addLogFileFixItem(String logFileFixItem)
public AppRulesSpec withLogFileFix(java.util.function.Consumer<List<String>> logFileFixSetter)
public AppRulesSpec withLogPathRule(List<LogPathRule> logPathRule)
public AppRulesSpec addLogPathRuleItem(LogPathRule logPathRuleItem)
public AppRulesSpec withLogPathRule(java.util.function.Consumer<List<LogPathRule>> logPathRuleSetter)
public List<LogPathRule> getLogPathRule()
public void setLogPathRule(List<LogPathRule> logPathRule)
public AppRulesSpec withNameRule(NameRule nameRule)
public AppRulesSpec withNameRule(java.util.function.Consumer<NameRule> nameRuleSetter)
public NameRule getNameRule()
public void setNameRule(NameRule nameRule)
public AppRulesSpec withPriority(Integer priority)
public Integer getPriority()
public void setPriority(Integer priority)
Copyright © 2022. All rights reserved.