filter
json {
source => “message”
}
This mean is Try to use json format transfer log, then put some data to message filed. So some filed just be setting, and some data set to message.
.Use this to check mach and log
https://grokconstructor.appspot.com/do/match
https://blog.johnwu.cc/article/elk-logstash-grok-filter.html
https://github.com/logstash-plugins/logstash-patterns-core/blob/master/patterns/grok-patterns
This is geth log for example
A:
INFO [11-14|09:58:17.730] Generating DAG in progress epoch=1 percentage=99 elapsed=4m8.643s
INFO [11-15|01:41:33.455] Generating DAG in progress epoch=1 percentage=9 elapsed=27.
雙11 有Line 回鐀Line point 10%,另外信用卡3.5% ,其他 商店街有折300和1100,1100搶不到,折300也不錯。
放在三層樓中每層樓接近 樓梯和中間,靠樓梯來互通吧,每層前後都收得到,算不錯了!
使用中跨樓層不會中斷,但訊號不見得很強,算是便宜中的精品了。
先建立index-pattern,匯出index-pattern json檔,然後刪除建立index-pattern後,再由rest api匯入。
1、顯示 index-pattern 列表 (先用web建立一個index-pattern)
curl http://localhost:5601/api/saved_objects/_find?type=index-pattern
2、匯出saved_objects index-pattern
curl http://localhost:5601/api/saved_objects/index-pattern/c0c02200-e6e0-11e8-b183-ebb59b02f871 > export.json
c0c02200-e6e0-11e8-b183-ebb59b02f871 是 1找到的id
json檔匯出後不可以直接用,必需頭尾補上
header補上:
{
“objects”: [
end補上:
]}
3、匯入saved_objects index-pattern (記得先砍了kibana-*)
curl -v -XPOST localhost:5601/api/kibana/dashboards/import?force=true -H ‘kbn-xsrf:true’ -H ‘Content-type:application/json’ -d @./export.json
json放在執行curl 同目錄就可以了
4、強制設定預設值 Kibana -> Managment -> Advanced Settings defaultIndex
curl -XPOST http://localhost:5601/api/kibana/settings/defaultIndex -H “kbn-xsrf: true” -H “Content-Type: application/json” -d ‘{“value”: “id”}’
id from export.json inside have id value
If already open kibana website, use Fresh (F5) page again.
Ray Tracy 一個工具或技術, 能否達到你的期望用途, 關鍵在於:
使用者是否充分了解他, 並且能夠熟練的駕馭他.
世上沒有絕對好用的工具, 也沒有絕對該用甚麼的場景:
我曾經深度挖掘 zfs 的各種參數, 試圖調到最好, 經過半年之後卻發現, 當我的 Workload 特性有細微改變的時候, zfs 會放大這些改變, 導致整個運作偏離我預想的方向….(其實就是參數過度優化: Over-optimized, 但我發現 zfs 的參數很容易讓你走上這條路)
這問題, 導致我必須經常監督 zfs 的表現, 並記錄我的 workload 每一個時間軸的變化趨勢, 好讓我在下周或下個月, 遇到新的問題時, 知道該朝甚麼方向改變甚麼參數, zfs 才能獲得最佳結果.
這對 Hacker 或 Geek 來說, 是件無比美好的事情, 因為他們每周都可以看到新的變化, 接受新的挑戰, 然後從當中挖掘出更多 zfs 新的參數組合與用途, 再來發表給大家聞香敬拜….
但對機房的 SRE 來說, 這件事情根本就是噩夢, 因為原本可以安穩睡一個星期的覺, 現在變成每天半夜都睡不著, 你不知道他是否會在半夜 3 點突然惡化, 導致線上有 50 萬個會員在交易的電商網站, 反應變慢, 破圖, 甚至無法交易, 最後被客戶從睡夢中挖起來解決問題…..
我也跟您一樣, 試圖解決 Storage 同步的問題, 而引進 Gluster 技術.
restart docker service iptables be reset
Docker Basic rule (New Docker maybe change somethings)
*nat
:PREROUTING ACCEPT [27:11935]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [598:57368]
:POSTROUTING ACCEPT [591:57092]
:DOCKER - [0:0]
-A PREROUTING -m addrtype –dst-type LOCAL -j DOCKER
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype –dst-type LOCAL -j DOCKER
-A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE
COMMIT
# Completed on Sun Sep 20 17:35:31 2015
# Generated by iptables-save v1.
http://blog.pulipuli.info/2011/07/
http://linux.vbird.org/linux_server/0250simple_firewall.php
iptables \[-AI 鏈\] \[-io 網路介面\] \[-p tcp,udp\] \\ \> \[-s 來源IP/網域\] \[--sport 埠口範圍\] \\ \> \[-d 目標IP/網域\] \[--dport 埠口範圍\] -j \[ACCEPT|DROP|REJECT\] 選項與參數: \--sport 埠口範圍:限制來源的埠口號碼,埠口號碼可以是連續的,例如 1024:65535 \--dport 埠口範圍:限制目標的埠口號碼。 \[root@www ~\]# iptables -A INPUT \[-m state\] \[--state 狀態\] 選項與參數: \-m :一些 iptables 的外掛模組,主要常見的有: state :狀態模組 mac :網路卡硬體位址 (hardware address) \--state :一些封包的狀態,主要有: INVALID :無效的封包,例如資料破損的封包狀態 ESTABLISHED:已經連線成功的連線狀態; NEW :想要新建立連線的封包狀態; RELATED :這個最常用!表示這個封包是與我們主機發送出去的封包有關 範例:只要已建立或相關封包就予以通過,只要是不合法封包就丟棄 \[root@www ~\]# iptables -A INPUT -m state \\ \> \--state RELATED,ESTABLISHED -j ACCEPT \[root@www ~\]# iptables -A INPUT -m state --state INVALID -j DROP https://www.
https://meta.discourse.org/t/applying-docker-discourse-iptables-rules-when-using-csf-firewall/70531/5
csf v12.08
NOTE: This feature is currently in BETA testing, so may not work correctly
This section provides the configuration of iptables rules to allow Docker
containers to communicate through the host. If the generated rules do not
work with your setup you will have to use a /etc/csf/csfpost.sh file and add
your own iptables configuration instead
1 to enable, 0 to disable