小编the*_*heG的帖子

使用 Dlog4j2.formatMsgNoLookups 在 elasticsearch helm 图表中进行 log4j 临时修复

我试图使用 Helm Chart 在 AKS 中设置一个 Elasticsearch 集群,但由于 log4j 漏洞,我想将其设置为-Dlog4j2.formatMsgNoLookups选项true。当我在 helm 命令中传递参数时,出现未知标志错误。参考:https ://artifacthub.io/packages/helm/elastic/elasticsearch/6.8.16

helm upgrade  elasticsearch elasticsearch --set imageTag=6.8.16 esJavaOpts "-Dlog4j2.formatMsgNoLookups=true"
Error: unknown shorthand flag: 'D' in -Dlog4j2.formatMsgNoLookups=true
Run Code Online (Sandbox Code Playgroud)

我还尝试在values.yaml文件中添加以下内容

esConfig: {}
#  elasticsearch.yml: |
#    key:
#      nestedkey: value
log4j2.properties: |
  -Dlog4j2.formatMsgNoLookups = true
Run Code Online (Sandbox Code Playgroud)

但这些值不会添加到/usr/share/elasticsearch/config/jvm.options,/usr/share/elasticsearch/config/log4j2.properties或 环境变量中。

log4j elasticsearch kubernetes kubernetes-helm elk

5
推荐指数
1
解决办法
6821
查看次数

带通配符的 grep

使用 grep 进行通配符搜索

我有一个包含许多 IP 地址的文件。我想列出文件中的所有 IP 地址,并使用了带有模式 192.16* 的 grep,但它没有显示 IP 地址的整个列表。仅当使用句点后跟星号符号时,我才能列出整个 IP 地址。所以我的疑问是为什么第二个选项不起作用但第三个选项工作正常。

root@test:~/test# cat z
192.168.1.0
192.168.2.0
192.168.110.7
192.168.115.5

1. root@test:~/test# grep -o 192.1 z
192.1
192.1
192.1
192.1


2. root@test:~/test# grep -o 192.1* z
192.1
192.1
192.1
192.1

3. root@test:~/test# grep -o 192.1. z
192.16
192.16
192.16
192.16


4. root@test:~/test# grep -o 192.1.* z
192.168.1.0
192.168.2.0
192.168.110.7
192.168.115.5
Run Code Online (Sandbox Code Playgroud)

bash grep wildcard

3
推荐指数
1
解决办法
3万
查看次数

标签 统计

bash ×1

elasticsearch ×1

elk ×1

grep ×1

kubernetes ×1

kubernetes-helm ×1

log4j ×1

wildcard ×1