質問編集履歴

2

td-agent.confの内容

2018/12/11 06:48

投稿

sonic883
sonic883

スコア6

test CHANGED
File without changes
test CHANGED
@@ -99,3 +99,35 @@
99
99
  }
100
100
 
101
101
  ```
102
+
103
+
104
+
105
+ 2018/12/11 15:46追記
106
+
107
+
108
+
109
+ 一つ抜けておりました。rsyslogで転送されたmaillogは、td-agentでelasticsearchへ投げるようになっています。
110
+
111
+ td-agent.confの内容は
112
+
113
+ ```
114
+
115
+ <source>
116
+
117
+ type tail
118
+
119
+ path /var/log/monitor/maillog
120
+
121
+ tag mail_log
122
+
123
+ pos_file /var/log/td-agent/mailmanmail_log.pos
124
+
125
+ format /^(?<date>[^ ]* [^ ]* [^ ]*) (?<time>[^ ]+) (?<host>[^ ]+) (?<process>[^:]+): (?<message>((?<key>[^ :]+)[ :])? ?((to|from)=<(?<address>[^>]+)>)?.*)$/
126
+
127
+ time_format %H:%M:%S
128
+
129
+ </source>
130
+
131
+ ```
132
+
133
+ です。

1

indexのmapping追記しました

2018/12/11 06:48

投稿

sonic883
sonic883

スコア6

test CHANGED
File without changes
test CHANGED
@@ -53,3 +53,49 @@
53
53
  /var/log/messageもElasticsearch関連の内容はありません。
54
54
 
55
55
  皆目見当がつかないので、ここをチェックするべき…など情報をいただけますでしょうか。
56
+
57
+
58
+
59
+ 以下、2018/12/11 13:00追記
60
+
61
+ このページ https://qiita.com/Kotatsu/items/1675231f857aaeec26d4 を参考にして、
62
+
63
+ mail_access-201812というindexを、sendmailのmaillogをもとにkibana上で作成しています。
64
+
65
+ curl http://localhost:9200/mail_access-201812/_mappingの結果は以下の通りです。
66
+
67
+ ```json
68
+
69
+ {"mail_access-201812":
70
+
71
+  {"mappings":
72
+
73
+   {"mail_log":
74
+
75
+    {"properties":
76
+
77
+     {"@timestamp":{"type":"date"},
78
+
79
+     "address":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
80
+
81
+     "date":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
82
+
83
+     "host":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
84
+
85
+     "key":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
86
+
87
+     "message":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
88
+
89
+     "process":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}
90
+
91
+     }
92
+
93
+    }
94
+
95
+   }
96
+
97
+  }
98
+
99
+ }
100
+
101
+ ```