Skip to content

Commit ae7069d

Browse files
committed
build-large-scale-low-cost-real-time-log-management-platform
1 parent aced374 commit ae7069d

File tree

1 file changed

+13
-4
lines changed
  • solution/tech-solution/build-large-scale-low-cost-real-time-log-management-platform

1 file changed

+13
-4
lines changed

solution/tech-solution/build-large-scale-low-cost-real-time-log-management-platform/main.tf

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff 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

7879
resource "alicloud_ecs_command" "run_command" {
@@ -85,15 +86,19 @@ export ALIBABA_CLOUD_ACCESS_KEY_SECRET=${alicloud_ram_access_key.ramak.secret}
8586
EOT
8687
8788
source ~/.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
8991
wget http://aliyun-observability-release-${var.region}.oss-${var.region}.aliyuncs.com/loongcollector/linux64/latest/loongcollector.sh -O loongcollector.sh
9092
chmod +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
9296
EOF
9397
)
9498
working_dir = "/root"
9599
type = "RunShellScript"
96100
timeout = 3600
101+
depends_on = [alicloud_instance.ecs_instance]
97102
}
98103

99104
resource "alicloud_ecs_invocation" "invoke_script" {
@@ -151,11 +156,15 @@ resource "alicloud_logtail_attachment" "this" {
151156
resource "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

161170
resource "alicloud_security_group" "security_group_kibana" {

0 commit comments

Comments
 (0)