顯示具有 opensearch 標籤的文章。 顯示所有文章
顯示具有 opensearch 標籤的文章。 顯示所有文章

2025/11/04

graylog 7 昨天發布

比較大的改變是不再使用 opensearch 而改用 graylog-datanode

照著官方文件安裝沒什麼問題

如果是在PVE上安裝

因為 mongodb 必須使用到cpu的 avx 功能

所以cpu type 至少要選 x86-64-v3 以上

這個在graylog 5 安裝時就有這個要求了

特別要注意的是以下流程跟之前不同

安裝完後必須 cat /var/log/graylog-server/server.log

找到首次進入系統的帳號密碼及連結

如下範例
http://admin:ghWgeIAkKl@10.0.0.1:9000

按照畫面上的流程步驟 使用預設值一直下一步即可

目前先把netflow轉到新版了 觀察一陣子看看


https://go2docs.graylog.org/current/setting_up_graylog/web_interface.htm#Prefligh

https://graylog.org/

https://go2docs.graylog.org/current/downloading_and_installing_graylog/red_hat_installation.htm

2024/05/09

這几天進graylog時提示6版已經出來了
看官網說的是可以直接更新
還是先裝一台來試看看好了
這次用的是almalinux 9
6版已經不再支援 elasticsearch 了
依照官網安裝流程裝到opensearch就有問題了
安裝後無法啟動
看了一下 opensearch.yml

裡面有一段 

######## Start OpenSearch Security Demo Configuration ########
# WARNING: revise all the lines below before you go into production
plugins.security.ssl.transport.pemcert_filepath: esnode.pem
plugins.security.ssl.transport.pemkey_filepath: esnode-key.pem
plugins.security.ssl.transport.pemtrustedcas_filepath: root-ca.pem
plugins.security.ssl.transport.enforce_hostname_verification: false
plugins.security.ssl.http.enabled: true
plugins.security.ssl.http.pemcert_filepath: esnode.pem
plugins.security.ssl.http.pemkey_filepath: esnode-key.pem
plugins.security.ssl.http.pemtrustedcas_filepath: root-ca.pem
plugins.security.allow_unsafe_democertificates: true
plugins.security.allow_default_init_securityindex: true
plugins.security.authcz.admin_dn: ['CN=kirk,OU=client,O=client,L=test,C=de']
plugins.security.audit.type: internal_opensearch
plugins.security.enable_snapshot_restore_privilege: true
plugins.security.check_snapshot_restore_write_privileges: true
plugins.security.restapi.roles_enabled: [all_access, security_rest_api_access]
plugins.security.system_indices.enabled: true
plugins.security.system_indices.indices: [.plugins-ml-agent, .plugins-ml-config, .plugins-ml-connector,
  .plugins-ml-controller, .plugins-ml-model-group, .plugins-ml-model, .plugins-ml-task,
  .plugins-ml-conversation-meta, .plugins-ml-conversation-interactions, .plugins-ml-memory-meta,
  .plugins-ml-memory-message, .plugins-ml-stop-words, .opendistro-alerting-config,
  .opendistro-alerting-alert*, .opendistro-anomaly-results*, .opendistro-anomaly-detector*,
  .opendistro-anomaly-checkpoints, .opendistro-anomaly-detection-state, .opendistro-reports-*,
  .opensearch-notifications-*, .opensearch-notebooks, .opensearch-observability, .ql-datasources,
  .opendistro-asynchronous-search-response*, .replication-metadata-store, .opensearch-knn-models,
  .geospatial-ip2geo-data*, .plugins-flow-framework-config, .plugins-flow-framework-templates,
  .plugins-flow-framework-state]
node.max_local_storage_nodes: 3
######## End OpenSearch Security Demo Configuration ########

感覺是這段的問題

備分後重新開一個新的 opensearch.yml
裡面的內容只要以下這些就好

cluster.name: graylog
node.name: ${HOSTNAME}
path.data: /var/lib/opensearch
path.logs: /var/log/opensearch
discovery.type: single-node
network.host: 0.0.0.0
action.auto_create_index: false
plugins.security.disabled: true
indices.query.bool.max_clause_count: 32768

改完後啟動就沒問題了

跟之前不同 graylog這個版本安裝好後
打開 http://127.0.0.1:9000 無法進到web介面 
看了一下 /var/log/graylog-server/server.log

It seems you are starting Graylog for the first time. To set up a fresh install, a setup interface has
been started. You must log in to it to perform the initial configuration and continue.

Initial configuration is accessible at 0.0.0.0:9000, with username 'admin' and password 'iIcCiFzjWY'.
Try clicking on http://admin:iIcCiFzjWY@0.0.0.0:9000

需要先 Initial configuration 才能使用
進入後依照畫面的步驟設定後 就能進入graylog的介面了

Memory/Heap usage 預設是1G 要再調整

/etc/sysconfig/graylog-server

GRAYLOG_SERVER_JAVA_OPTS="-Xms1g -Xmx1g -server -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow"

依ram大小調整



2023/05/05

一直以來都會定時去 graylog 撈 資料

會使用到多個 OR 的下法

accept AND ( 192.168.33.238 OR 192.168.34.215 OR 192.168.33.43 OR 192.168.34.142 OR 192.168.54.247 OR 192.168.7.253 OR 192.168.26.237 OR 192.168.26.228 OR 192.168.25.211 OR 192.168.25.206 OR 192.168.25.117 OR 192.168.26.104 OR 192.168.25.183 OR 192.168.31.241 OR 192.168.30.112 OR 192.168.30.80 OR 192.168.29.6 OR 192.168.29.3 OR 192.168.30.60 OR 192.168.30.58 OR 192.168.29.143 OR 192.168.30.57 OR 192.168.29.223 OR 192.168.29.164 OR 192.168.29.84 OR 192.168.30.200 OR 192.168.30.32 OR 192.168.29.29 OR 192.168.29.199 OR 192.168.29.205 OR 192.168.29.210 OR 192.168.29.200 OR 192.168.29.234 OR 192.168.30.220 OR 192.168.30.194 OR 192.168.29.83 OR 192.168.29.4 OR 192.168.30.108 OR 192.168.29.177 OR 192.168.29.107 OR 192.168.29.32 OR 192.168.30.33 OR 192.168.30.173 OR 192.168.30.247 OR 192.168.30.122 OR 192.168.30.55 OR 192.168.29.19 OR 192.168.29.10 OR 192.168.30.123 OR 192.168.30.201 OR 192.168.29.253 OR 192.168.30.85 OR 192.168.29.48 OR 192.168.30.37 OR 192.168.30.66 OR 192.168.9.100 OR 192.168.30.163 OR 192.168.30.114 OR 192.168.30.59 OR 192.168.30.199 OR 192.168.30.227 OR 192.168.30.41 OR 192.168.29.246 OR 192.168.29.161 OR 192.168.74.248 OR 192.168.74.12 OR 192.168.10.111 OR 192.168.10.104 OR 192.168.50.154 OR 192.168.52.1 OR 192.168.52.3 OR 192.168.50.243 OR 192.168.50.220 OR 192.168.50.179 OR 192.168.50.99 OR 192.168.50.138 OR 192.168.50.98 OR 192.168.50.182 OR 192.168.50.206 OR 192.168.50.234 )


但今天使用同樣的語法

出現以下的 error


While retrieving data for this widget, the following error(s) occurred:

OpenSearch exception [type=too_many_nested_clauses, reason=Query contains too many nested clauses; maxClauseCount is set to 1024].


問了bing


要修改 /etc/opensearch/opensearch.yml

加上 

indices.query.bool.max_clause_count: 10240

重啟 opensearch 目前正常

2022/12/16

graylog 迎來了5 版的更新

依然還是無法原几升級

記錄一下安裝的過程 以debian 11 為例

依照官方文件的流程 先裝mongodb

由於新版的mongodb需要使用 cpu 的 avx 功能

所以proxmox 上 guest的 cpu type 必須要改成 host 不能使用 預設值 kvm64

光是這個問題就卡關好久

而且mongodb 5版裝完後無法執行 6 版沒問題

接下來新的版本可以選擇使用 

OpenSearch 或 Elasticsearch

我是選擇 Elasticsearch

第三步是安裝 graylog server

安裝後調整參數

/etc/elasticsearch/jvm.options 這個檔

-Xms8g
-Xmx8g

以上的參數依照記憶体進行調整


/etc/default/graylog-server 檔案裡

GRAYLOG_SERVER_JAVA_OPTS="-Xms1g -Xmx1g -server -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow"


-Xms1g -Xmx1g

這二個參數也是依照記憶体進行調整


其他依文件安裝問題不大

不過文件上有些斷行有問題 需要自行調整

例如

wget -qO - https://www.mongodb.org/static/pgp/server-5.x.asc | sudo apt-key add -

echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.x main" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.x.list

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -


echo "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list


另外使用almalinux 8 跟 9 安裝過程沒有出現錯誤 但 graylog server 啟動打開管理介面

出現以下的錯誤



Error Loading active authentication service type failed with status: SyntaxError: JSON.parse: unexpected character at line 2 column 1 of the JSON data

不知道是那裡出問題 有空再來試了

找到問題了 firewalld 沒關

systemctl disable firewalld

systemctl stop firewalld


https://go2docs.graylog.org/5-0/what_is_graylog/what_is_graylog.htm