File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
solution/tech-solution/build-large-scale-low-cost-real-time-log-management-platform Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ resource "alicloud_instance" "ecs_instance" {
7373 vswitch_id = alicloud_vswitch. vswitch . id
7474 password = var. ecs_instance_password
7575 internet_max_bandwidth_out = 5
76+ depends_on = [alicloud_log_store_index . sls_index ]
7677}
7778
7879resource "alicloud_ecs_command" "run_command" {
@@ -85,15 +86,19 @@ export ALIBABA_CLOUD_ACCESS_KEY_SECRET=${alicloud_ram_access_key.ramak.secret}
8586EOT
8687
8788source ~/.bash_profile
88- curl -fsSL https://help-static-aliyun-doc.aliyuncs.com/tech-solution/install-log-monitoring-alarming-0.1.sh|bash
89+ sleep 60
90+ # Install loongcollector
8991wget http://aliyun-observability-release-${ var . region } .oss-${ var . region } .aliyuncs.com/loongcollector/linux64/latest/loongcollector.sh -O loongcollector.sh
9092chmod +x loongcollector.sh
9193./loongcollector.sh install ${ var . region } -internet
94+ # Generate log
95+ curl -fsSL https://help-static-aliyun-doc.aliyuncs.com/tech-solution/install-log-monitoring-alarming-0.1.sh|bash
9296EOF
9397 )
9498 working_dir = " /root"
9599 type = " RunShellScript"
96100 timeout = 3600
101+ depends_on = [alicloud_instance . ecs_instance ]
97102}
98103
99104resource "alicloud_ecs_invocation" "invoke_script" {
@@ -151,11 +156,15 @@ resource "alicloud_logtail_attachment" "this" {
151156resource "alicloud_log_store_index" "sls_index" {
152157 project = alicloud_log_project. sls_project . project_name
153158 logstore = alicloud_log_store. sls_log_store . logstore_name
154- full_text {}
159+ full_text {
160+ token = " :#$^*\r\n\t "
161+ }
155162 field_search {
156- name = " content"
157- type = " text"
163+ name = " content"
164+ type = " text"
165+ token = " :#$^*\r\n\t "
158166 }
167+ depends_on = [alicloud_log_store . sls_log_store ]
159168}
160169
161170resource "alicloud_security_group" "security_group_kibana" {
You can’t perform that action at this time.
0 commit comments