The machine identity uses the expression of fuzzy matching (=~), and its value can only be selected one by one.
Relevant server.conf | webapi.conf
# debug, release
RunMode = "release"
# # custom i18n dict config
# I18N = "./etc/i18n.json"
# # custom i18n request header key
# I18NHeaderKey = "X-Language"
# metrics descriptions
MetricsYamlFile = "./etc/metrics.yaml"
BuiltinAlertsDir = "./etc/alerts"
BuiltinDashboardsDir = "./etc/dashboards"
# config | api
ClustersFrom = "config"
# using when ClustersFrom = "api"
ClustersFromAPIs = []
[[NotifyChannels]]
Label = "é®ç®±"
# do not change Key
Key = "email"
[[NotifyChannels]]
Label = "å为äºè¯é³"
# do not change Key
Key = "voice"
[[NotifyChannels]]
Label = "ä¼ä¸å¾®ä¿¡èªå»ºåºç¨"
# do not change Key
Key = "weixinworkApp"
[[NotifyChannels]]
Label = "å为äºçä¿¡"
# do not change Key
Key = "sms"
[[NotifyChannels]]
Label = "ééæºå¨äºº"
# do not change Key
Key = "dingtalk"
[[NotifyChannels]]
Label = "ä¼å¾®æºå¨äºº"
# do not change Key
Key = "wecom"
[[NotifyChannels]]
Label = "é£ä¹¦æºå¨äºº"
# do not change Key
Key = "feishu"
[[NotifyChannels]]
Label = "mm bot"
# do not change Key
Key = "mm"
[[NotifyChannels]]
Label = "telegramæºå¨äºº"
# do not change Key
Key = "telegram"
[[ContactKeys]]
Label = "Wecom Robot Token"
# do not change Key
Key = "wecom_robot_token"
[[ContactKeys]]
Label = "Dingtalk Robot Token"
# do not change Key
Key = "dingtalk_robot_token"
[[ContactKeys]]
Label = "Feishu Robot Token"
# do not change Key
Key = "feishu_robot_token"
[[ContactKeys]]
Label = "MatterMost Webhook URL"
# do not change Key
Key = "mm_webhook_url"
[[ContactKeys]]
Label = "Telegram Robot Token"
# do not change Key
Key = "telegram_robot_token"
[Log]
# log write dir
Dir = "logs"
# log level: DEBUG INFO WARNING ERROR
Level = "DEBUG"
# stdout, stderr, file
Output = "stdout"
# # rotate by time
# KeepHours: 4
# # rotate by size
# RotateNum = 3
# # unit: MB
# RotateSize = 256
[HTTP]
# http listening address
Host = "0.0.0.0"
# http listening port
Port = 18000
# https cert file path
CertFile = ""
# https key file path
KeyFile = ""
# whether print access log
PrintAccessLog = true
# whether enable pprof
PProf = false
# http graceful shutdown timeout, unit: s
ShutdownTimeout = 30
# max content length: 64M
MaxContentLength = 67108864
# http server read timeout, unit: s
ReadTimeout = 20
# http server write timeout, unit: s
WriteTimeout = 40
# http server idle timeout, unit: s
IdleTimeout = 120
[JWTAuth]
# signing key
SigningKey = "xxx"
# unit: min
AccessExpired = 1500
# unit: min
RefreshExpired = 10080
RedisKeyPrefix = "/jwt/"
[ProxyAuth]
# if proxy auth enabled, jwt auth is disabled
Enable = false
# username key in http proxy header
HeaderUserNameKey = "X-User-Name"
DefaultRoles = ["Standard"]
[BasicAuth]
user001 = "xxxx"
[AnonymousAccess]
PromQuerier = false
AlertDetail = false
[LDAP.Attributes]
Nickname = "cn"
Phone = "homePhone"
#Email = "mail"
Username = "cn"
name = "cn"
surname = "cn"
username = "cn"
member_of = "memberOf"
email = "mail"
[OIDC]
Enable = false
DisplayName = "OIDCç»å½"
RedirectURL = "http://n9e.com/callback"
SsoAddr = "http://sso.example.org"
ClientId = ""
ClientSecret = ""
CoverAttributes = true
DefaultRoles = ["Standard"]
[OIDC.Attributes]
Nickname = "nickname"
Phone = "phone_number"
Email = "email"
[CAS]
Enable = false
DisplayName = "CASç»å½"
SsoAddr = "https://cas.example.com/cas/"
RedirectURL = "http://127.0.0.1:18000/callback/cas"
CoverAttributes = false
# cas user default roles
DefaultRoles = ["Standard"]
[CAS.Attributes]
Nickname = "nickname"
Phone = "phone_number"
Email = "email"
[OAuth]
Enable = false
DisplayName = "OAuth2ç»å½"
RedirectURL = "http://127.0.0.1:18000/callback/oauth"
SsoAddr = "https://sso.example.com/oauth2/authorize"
TokenAddr = "https://sso.example.com/oauth2/token"
UserInfoAddr = "https://api.example.com/api/v1/user/info"
# "header" "querystring" "formdata"
TranTokenMethod = "header"
ClientId = ""
ClientSecret = ""
CoverAttributes = true
DefaultRoles = ["Standard"]
UserinfoIsArray = false
UserinfoPrefix = "data"
Scopes = ["profile", "email", "phone"]
[OAuth.Attributes]
# Username must be defined
Username = "username"
Nickname = "nickname"
Phone = "phone_number"
Email = "email"
# example
# # nested : UserinfoIsArray=false, UserinfoPrefix="data"
# # {"data":{"username":"123456","nickname":"å§å"},"code":0,"message":"ok"}
# # nested and array : UserinfoIsArray=true, UserinfoPrefix="data"
# # {"data":[{"username":"123456","nickname":"å§å"}],"code":0,"message":"ok"}
# # flat : UserinfoIsArray=false, UserinfoPrefix=""
# # {"username":"123456","nickname":"å§å"}
# # flat and array : UserinfoIsArray=true, UserinfoPrefix=""
# # [{"username":"123456","nickname":"å§å"}]
[Redis]
# address, ip:port or ip1:port,ip2:port for cluster and sentinel(SentinelAddrs)
Address = "127.0.0.1:16379"
# Username = ""
Password = "xxx"
# DB = 0
# UseTLS = false
# TLSMinVersion = "1.2"
# standalone cluster sentinel
RedisType = "standalone"
# Mastername for sentinel type
# MasterName = "mymaster"
# SentinelUsername = ""
# SentinelPassword = ""
[DB]
DSN="xxx:xxxx@tcp(127.0.0.1:3306)/n9e_v5?charset=utf8mb4&parseTime=True&loc=Local&allowNativePasswords=true"
# enable debug mode or not
Debug = false
# mysql postgres
DBType = "mysql"
# unit: s
MaxLifetime = 7200
# max open connections
MaxOpenConns = 150
# max idle connections
MaxIdleConns = 50
# table prefix
TablePrefix = ""
# enable auto migrate or not
# EnableAutoMigrate = false
[[Clusters]]
# Prometheus cluster name
Name = "shuitu-VictoriaMetrics"
# Prometheus APIs base url
Prom = "http://127.0.0.1:8428"
# VictoriaMetrics APIs base url
#Prom = "http://127.0.0.1:8428"
# Basic auth username
BasicAuthUser = ""
# Basic auth password
BasicAuthPass = ""
# timeout settings, unit: ms
Timeout = 30000
DialTimeout = 3000
MaxIdleConnsPerHost = 100
Headers = ["X-From", "n9e"]
[[Clusters]]
# Prometheus cluster name
Name = "shuitu-Prometheus"
# Prometheus APIs base url
Prom = "http://xxx:9090"
# VictoriaMetrics APIs base url
#Prom = "http://127.0.0.1:8428"
# Basic auth username
BasicAuthUser = ""
# Basic auth password
BasicAuthPass = ""
# timeout settings, unit: ms
Timeout = 30000
DialTimeout = 3000
MaxIdleConnsPerHost = 100
Headers = ["X-From", "n9e"]
[Ibex]
Address = "http://127.0.0.1:10090"
# basic auth
BasicAuthUser = "ibex"
BasicAuthPass = "ibex"
# unit: ms
Timeout = 3000
[TargetMetrics]
TargetUp = '''max(max_over_time(target_up{ident=~"(%s)"}[%dm])) by (ident)'''
LoadPerCore = '''max(max_over_time(system_load_norm_1{ident=~"(%s)"}[%dm])) by (ident)'''
MemUtil = '''100-max(max_over_time(mem_available_percent{ident=~"(%s)"}[%dm])) by (ident)'''
DiskUtil = '''max(max_over_time(disk_used_percent{ident=~"(%s)", path="/"}[%dm])) by (ident)'''
Relevant logs
å端é®é¢ï¼å±ä¸æä¾å端æ¥å¿ã
System info
v6.5.0
Steps to reproduce
æºå¨æ è¯ä½¿ç¨æ³å¹é (=~)ç表达å¼ï¼å ¶å¼è¿æ¯åªè½ä¸ä¸ªä¸ä¸ªéæ© 1ãç¹å»å建åè¦è§å 2ãéæ©host 3ãéæ©æºå¨æ è¯ 4ãéæ©=~ 5ã鿩䏻æºå表
夿³¨ï¼ æå¨è¾å ¥ä¸»æºå表ï¼ä¾å¦172.20.*ï¼ä¸æ¸ æ¥è½ä¸è½è¯å«å°ã è¿è¯·å¤§å¥ä»¬æå¯¼ä¸ï¼æ¯ç¨åºé»è¾å°±æ¯è¿ä¹è®¾è®¡çè¿æ¯ç©æ³å§¿å¿ä¸å¯¹ã
éæ±ï¼ è½æ¯æä¸å¡ç»ãæ ç¾çæ³å¹é 飿¯ææ£çãæ¥éè¿åè½ãè¿åè½ä¸æ¦ä¸çº¿ï¼å°æåé ç½®æçãç°å¨é ç½®åè¦è§åç¸å¯¹æ¥è¯´è¿æ¯æ¯è¾æ»æ¿çã
Expected behavior
å建åè¦è§å
Actual behavior
å建åè¦è§å
Additional info
No response
=~ 支持配置 172.20.*
@710leo 可以支持下业务组、标签的泛匹配吗?谢谢