-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands
974 lines (777 loc) · 20.4 KB
/
commands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
Welcome to Elastic training
Sl:No URL Link Username Password
1 https://cloud.palmeto.co.in Pepsico-Elastic01 P@lmeto@456 Marco
2 https://cloud.palmeto.co.in Pepsico-Elastic02 P@lmeto@456 Najma
3 https://cloud.palmeto.co.in Pepsico-Elastic03 P@lmeto@456 manisha
4 https://cloud.palmeto.co.in Pepsico-Elastic04 P@lmeto@456 raashi
5 https://cloud.palmeto.co.in Pepsico-Elastic05 P@lmeto@456 trinath
6 https://cloud.palmeto.co.in Pepsico-Elastic06 P@lmeto@456 subash
7 https://cloud.palmeto.co.in Pepsico-Elastic07 P@lmeto@456 amit
8 https://cloud.palmeto.co.in Pepsico-Elastic08 P@lmeto@456 kiran
9 https://cloud.palmeto.co.in Pepsico-Elastic09 P@lmeto@456 dilip
10 https://cloud.palmeto.co.in Pepsico-Elastic10 P@lmeto@456 Anand Tiwari
11 https://cloud.palmeto.co.in Pepsico-Elastic11 P@lmeto@456 Tanisha
12 https://cloud.palmeto.co.in Pepsico-Elastic12 P@lmeto@456 Sakshi
13 https://cloud.palmeto.co.in Pepsico-Elastic13 P@lmeto@456 Srikanth
14 https://cloud.palmeto.co.in Pepsico-Elastic14 P@lmeto@456 Lourdes
15 https://cloud.palmeto.co.in Pepsico-Elastic15 P@lmeto@456
16 https://cloud.palmeto.co.in Pepsico-Elastic16 P@lmeto@456 Jamil
17 https://cloud.palmeto.co.in Pepsico-Elastic17 P@lmeto@456
18 https://cloud.palmeto.co.in Pepsico-Elastic18 P@lmeto@456 Radhika
19 https://cloud.palmeto.co.in Pepsico-Elastic19 P@lmeto@456
20 https://cloud.palmeto.co.in Pepsico-Elastic20 P@lmeto@456
21 https://cloud.palmeto.co.in Pepsico-Elastic21 P@lmeto@456
22 https://cloud.palmeto.co.in Pepsico-Elastic22 P@lmeto@456
23 https://cloud.palmeto.co.in Pepsico-Elastic23 P@lmeto@456
24 https://cloud.palmeto.co.in Pepsico-Elastic24 P@lmeto@456
25 https://cloud.palmeto.co.in Pepsico-Elastic25 P@lmeto@456
## elastic integration
https://docs.elastic.co/integrations
## connect to ubuntu node and switch to root user
sudo su
## get the laetst repo details
apt update
## Install latest patches
apt upgrade -y
# Installation instruction
https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html
## install elastic pgp key
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
## install the transport https package
apt-get install apt-transport-https -y
## run the command to remove the wrong file
rm /etc/apt/sources.list.d/elastic-8.x.list
## Create apt file with source and url
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
## get the laetst repo details
apt update
## install elastic search
apt install elasticsearch -y
![](/uploads/upload_da7d06d8d4822a3fcbfb227e6f912b74.png)
## command to read the config file
cat /etc/elasticsearch/elasticsearch.yml
## reload the daemon
systemctl daemon-reload
## start elastic search
systemctl start elasticsearch
## check the status of elastic search
systemctl status elasticsearch
## enable auto start on reboot
systemctl enable elasticsearch
## access elastic on browser via rest api
https://{ubuntu ip addrss}:9200
## command to generate a new password for elastic
/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
## install kibana
apt install kibana
## start kibana
systemctl start kibana
## check the status of kibana
systemctl status kibana
## enable auto start on reboot
systemctl enable kibana
## edidt kibana config to listen on any interface
vi /etc/kibana/kibana.yml
## add 0.0.0.0 interface to server host
server.host: "0.0.0.0"
## restart kibana
systemctl restart kibana
## access kibana on browser
https://{ubuntu ip addrss}:5601
## create a enroleent token for kibana
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
## get the verification otp of kibana
/usr/share/kibana/bin/kibana-verification-code
## command to set custom password
/usr/share/elasticsearch/bin/elasticsearch-reset-password --interactive -u elastic
## various subscruiptions
https://www.elastic.co/subscriptions
## get the cluster health
GET _cluster/health
## on command line
curl -k https://localhost:9200/_cluster/health
## devtool json to list the index
GET _cat/indices
## create new index
PUT my-index
## close a index
POST /my-index/_close
## open a index
POST /my-index/_open
## create index with custom replicas and shards
PUT my-test-index
{
"settings": {
"index": {
"number_of_shards": 3,
"number_of_replicas": 2
}
}
}
## Create a document with in the index
PUT my-index/_doc/1
{
"year": 2023,
"city": "chennai",
"country": "india",
"population_M": 132.324
}
## Createa anothe document wth different id
PUT my-index/_doc/2
{
"year": 2023,
"city": "Banglore",
"country": "india",
"population_M": 120.324
}
## get the index
GET my-index/_search
## Create a document with auto id
POST my-index/_doc/
{
"year": 2023,
"city": "mumbai",
"country": "india",
"population_M": 100.324
}
## get the mapping of index
GET my-index/_mapping
## try to load a data with different data type
POST my-index/_doc/
{
"year": "2023",
"city": "delhi",
"country": "india",
"population_M": "80.12 million"
}
## createa index with pre defined mapping
PUT my-explicit-index1
{
"mappings": {
"properties": {
"year": {
"type": "integer"
},
"city": {
"type": "keyword"
},
"country": {
"type": "keyword"
},
"population_M": {
"type": "float"
},
"attacgtions": {
"type": "text"
}
}
}
}
## elastic search mapping types
https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html
## post document to explisite index
POST my-explicit-index1/_doc
{
"year": "2023",
"city": "mumbai",
"country": "india",
"population_M": 4.936,
"attractions": "india gate, taj,"
}
## get the document
GET my-explicit-index1/_search
## object data
PUT my-index-000001/_doc/1
{
"region": "US",
"manager": {
"age": 30,
"name": {
"first": "John",
"last": "Smith"
}
}
}
## repo with toc
https://github.com/sathishbob/elasstic
## elstic routing archecture
https://blog.devgenius.io/elasticsearch-architecture-vi-routing-f88e7fb390d7
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shard-routing.html
## to get count of documents
GET my-index-000001/_count
## array in index
PUT my-index-000002/_doc/1
{
"message": "some arrays in this document...",
"tags": [ "elasticsearch", "wow" ],
"lists": [
{
"name": "prog_list",
"description": "programming list"
},
{
"name": "cool_list",
"description": "cool stuff list"
}
]
}
PUT my-index-000002/_doc/2
{
"message": "no arrays in this document...",
"tags": "elasticsearch",
"lists": {
"name": "prog_list",
"description": "programming list"
}
}
## the data will be falltened in the backend as
"lists.name": ["prog_list", "cool_list"]
## Search with tag field
GET my-index-000002/_search
{
"query": {
"match": {
"tags": "elasticsearch"
}
}
}
## to user wild character in the sting search
GET my-index-000002/_search
{
"query": {
"query_string": {
"query": "elastic*" ,
"default_field": "tags"
}
}
}
## query string documentation
https://www.elastic.co/guide/en/elasticsearch/reference/current/full-text-queries.html
## query for a string
GET my-index-000002/_search
{
"query": {
"query_string": {
"query": "*wow*"
}
}
}
## query based on the array value
GET my-index-000002/_search
{
"query": {
"query_string": {
"query": "*cool*",
"default_field": "lists.name"
}
}
}
## index with nested
PUT stores
{
"mappings": {
"properties": {
"suburb": {
"type": "keyword"
},
"product": {
"type": "nested"
}
}
}
}
## create document inside the index
POST stores/_doc
{
"suburb":"Carlton",
"product":[
{
"product":"i20 Hatch",
"quantity":21
},
{
"product":"i30 Sport",
"quantity":300
}
]
}
## create another document
POST stores/_doc
{
"suburb":"Fitzroy",
"product":[
{
"product":"Mustang",
"quantity":10
},
{
"product":"i20 Hatch",
"quantity":10
}
]
}
## search with nested field
GET stores/_search
{
"query": {
"nested": {
"path": "product",
"query": {
"bool": {
"must": [
{"match": {"product.product.keyword": "Mustang"}}
]
}
}
}
}
}
## multi filter in nested index
GET stores/_search
{
"query": {
"nested": {
"path": "product",
"query": {
"bool": {
"must": [
{
"match": {
"product.product.keyword": "i30 Sport"
}
},
{
"range": {
"product.quantity": { "lt": 50 }
}
}
]
}
}
}
}
}
## sucess with two document
GET stores/_search
{
"query": {
"nested": {
"path": "product",
"query": {
"bool": {
"must": [
{
"match": {
"product.product.keyword": "i20 Hatch"
}
},
{
"range": {
"product.quantity": { "lt": 25 }
}
}
]
}
}
}
}
}
## sucess with one document
GET stores/_search
{
"query": {
"nested": {
"path": "product",
"query": {
"bool": {
"must": [
{
"match": {
"product.product.keyword": "i20 Hatch"
}
},
{
"range": {
"product.quantity": { "lt": 20 }
}
}
]
}
}
}
}
}
## should condition in nested
"bool": {
"should": [
{
"term": {
"brandsvisited": "adidas"
}
},
{
"term": {
"brandsvisited": "skechers"
}
}
],
"minimum_should_match": 1
}
}
## Get heap memory usage
GET _cat/nodes?h=heap*&v
## install git
apt install git -y
## cd to /home/palmeto
cd /home/palmeto/
## clone the repo
git clone https://github.com/sathishbob/elasstic.git
## go inside elastic dir
cd elasstic/
## pull the latest code
git pull
## install curl
apt install curl -y
## Create index template from centos machine
curl -f -k -XPUT "https://{elastic-ip}:9200/_index_template/web-logs" -u elastic:{your elastic password} -H 'Content-Type: application/json' -d "@web-log-template.json"
## Create index template from elastic mahine
curl -f -k -XPUT "https://localhost:9200/_index_template/web-logs" -u elastic:{your elastc password} -H 'Content-Type: application/json' -d "@web-log-template.json"
## command to list temlates
GET _cat/templates/
## get the template from elastic
GET /_index_template/web-logs
## sample log
f=p36%2Cb447%2Cb145%2C1130%7C6&page=0&o66.249.66.194 - - [20/Sep/2023:04:09:32 +0330] "GET /filter?=1130 HTTP/1.1" 302 0 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" "-"
## grok pattern
^%{IP:ip} - - \[%{HTTPDATE:timestamp}\] "%{WORD:verb} %{DATA:request}" %{NUMBER:status} %{NUMBER:bytes}
## do git pull toe get the pipline file
git pull
## create pipeline with json
curl -f -k -XPUT "https://{elastic-ip}:9200/_ingest/pipeline/web-logs" -u elastic:{your elastc password} -H 'Content-Type: application/json' -d "@web-logs-pipeline.json"
## install log stash
apt install logstash
## do a git pull n elastic server (ubuntu)
git pull
## edit the conf file tand add your elastic password
nano web-logs-logstash.conf
#change the hosts url
hosts => "https://localhost:9200"
# enter your elastic password
password =>
## to save
CTRL+o -- enter -- CTRL+x
## run the logstash with the config
/usr/share/logstash/bin/logstash -f /home/palmeto/elasstic/web-logs-logstash.conf < web.log
## get server cer to file
echo -n | openssl s_client -connect localhost:9200 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ./ca_logstash.cer
## install java
apt install default-jdk -y
## import the key
keytool -import -alias elastic -file ca_logstash.cer -keystore /usr/share/logstash/jdk/lib/security/cacerts
password: changeit
## run the logstash with the config
/usr/share/logstash/bin/logstash -f /home/palmeto/elasstic/web-logs-logstash.conf < web.log
## get the documents from the index
GET web-logs/_search
## query records with status code as 200
GET web-logs/_search
{
"query": {
"term": {
"http.response.status_code": { "value": "200" }
}
}
}
## quey with multiple fiilters
GET web-logs/_search
{
"query": {
"bool": {
"must_not": [
{ "term": {
"http.response.status_code": { "value": "200" }
}
}
],
"must": [
{ "term": {
"http.request.method": { "value": "POST" }
}
}
]
}
}
}
## filter using match
GET web-logs/_search
{
"query": {
"match": {
"event.original":{
"query": "refrigerator windows",
"operator": "and"
}
}
}
}
## filter using term
GET web-logs/_search
{
"query": {
"terms": {
"source.geo.country_name": [
"South Africa",
"Ireland",
"Hong Kong"
]
}
}
}
## aggerate
GET web-logs/_search?size=0
{
"query": {
"range": {
"@timestamp": {
"gte": "2023-09-23T00:00:00.000Z",
"lt": "2023-09-24T00:00:00.000Z"
}
}
},
"aggs": {
"bytes_served": {
"sum": {
"field": "http.response.body.bytes"
}
}
}
}
## aggregate
GET web-logs/_search?size=0
{
"query": {
"range": {
"@timestamp": {
"gte": "2023-09-23T00:00:00.000Z",
"lt": "2023-09-24T00:00:00.000Z"
}
}
},
"aggs": {
"hourly": {
"date_histogram": {
"field": "@timestamp",
"fixed_interval": "1h"
},
"aggs": {
"bytes_served": {
"sum": { "field": "http.response.body.bytes" }
}
}
}
}
}
## must with 2 queries
GET web-logs/_search
{
"query": {
"bool": {
"must": [
{ "term": {
"http.response.status_code": { "value": "200" }
}
},
{ "term": {
"http.request.method": { "value": "POST" }
}
}
]
}
}
}
}
## conenct to centos and install updates
yum update
## elastic url
https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html
## install signing key
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
## create a file
vi /etc/yum.repos.d/elasticsearch.repo
## put the contenet
[elasticsearch]
name=Elasticsearch repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md
## install file beat
yum install --enablerepo=elasticsearch filebeat -y
## filebeat module
https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-modules.html
## edit the filebeat yaml
vi /etc/filebeat/filebeat.yml
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["{elastic ip}:9200"]
# Protocol - either `http` (default) or `https`.
protocol: "https"
# Authentication credentials - either API key or username/password.
#api_key: "id:api_key"
username: "elastic"
password: "{your password}"
ssl.verification_mode: "none"
## enable system module
filebeat modules enable system
vi /etc/filebeat/modules.d/system.yml
enabled: true
## setup kibana
filebeat setup --pipelines -E "setup.kibana.host=192.168.11.87:5601" --modules system -M "system.syslog.enabled=true" -M "system.auth.enabled=true"
## setup kibana with dashboard
filebeat setup --dashboards --pipelines -E "setup.kibana.host=192.168.11.87:5601" --modules system -M "system.syslog.enabled=true" -M "system.auth.enabled=true"
## filebeat .yaml with custom index name
setup.template.name: "centos"
setup.template.pattern: "centos-%{[agent.version]}"
setup.dashboard.index: "centos-*"
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["192.168.11.87:9200"]
# Protocol - either `http` (default) or `https`.
protocol: "https"
# Authentication credentials - either API key or username/password.
#api_key: "id:api_key"
username: "elastic"
password: "training"
ssl.verification_mode: "none"
index: "centos-%{+yyyy.MM.dd}"
## restart file beat
systemctl restart filebeat
## install epel release
yum install epel-release -y
yum install nginx -y
## start and enable nginx
systemctl start nginx
systemctl enable nginx
## stop filrewall
systemctl stop firewalld
## check nginx log files were created
ls -l /var/log/nginx/
## enable nginx module
filebeat modules enable nginx
## enable the logfiles
vi /etc/filebeat/modules.d/nginx.yml
# Module: nginx
# Docs: https://www.elastic.co/guide/en/beats/filebeat/8.10/filebeat-module-nginx.html
- module: nginx
# Access logs
access:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
#var.paths:
# Error logs
error:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
#var.paths:
## setup pipline and dash board
filebeat setup -E "setup.kibana.host={elastic ip}:5601" --modules nginx --dashboards --pipelines -M "nginx.access.enabled=true" -M "nginx.error.enabled=true"
## test filebeat config
filebeat test config
## test filebeat connectivity
filebeat test output
## restart filebeat
systemctl restart filebeat
#### metric beat
## install metric beat
yum install --enablerepo=elasticsearch metricbeat
# edit metribeat yaml
vi /etc/metricbeat/metricbeat.yml
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["192.168.11.87:9200"]
# Protocol - either `http` (default) or `https`.
protocol: "https"
# Authentication credentials - either API key or username/password.
#api_key: "id:api_key"
username: "elastic"
password: "training"
ssl.verification_mode: "none"
## enable metric beat
metricbeat modules enable system
## setup kibana
metricbeat setup -E "setup.kibana.host=192.168.11.87:5601"
## start metricbeat
systemctl restart metricbeat
systemctl status metricbeat
## kql document
https://www.elastic.co/guide/en/kibana/current/kuery-query.html
## metric beat reference
https://www.elastic.co/guide/en/beats/metricbeat/current/index.html
## audit beat
yum install --enablerepo=elasticsearch auditbeat
## packet beat
yum install --enablerepo=elasticsearch packetbeat
## get index pressure details
GET /_nodes/stats/indexing_pressure
### logstash
vi logstash-first.conf
input {
stdin {}
}
filter {
mutate {
add_field => { "description" => "testing first job" }
}
}
output {
stdout {}
}
## first pipleine
echo 'testing logstash' | /usr/share/logstash/bin/logstash -f /home/palmeto/elasstic/logstash-first.conf
echo -e 'testing logstash1 \ntesting logstash2' | /usr/share/logstash/bin/logstash -f /home/palmeto/elasstic/logstash-first.conf
## cd to the repo dir
cd /home/palmeto/elasstic
## do a git pull
git pull
## go inside csv folder
cd csv
## edit conf file
nano logstash-taxi.conf
##execute log stash
/usr/share/logstash/bin/logstash -f /home/palmeto/elasstic/csv/logstash-taxi.conf
#
### parsing sys log
cd /home/palmeto/elasstic
cd syslog
## run the syslog
/usr/share/logstash/bin/logstash -f /home/palmeto/elasstic/syslog/logstash-syslog.conf < linux-system.log
## feed back link
https://forms.office.com/r/6eWUarbm2R
### look of data
cd /home/palmeto/elasstic
git pull
cd lookup
nano logstash-firewall-enrich.conf
/usr/share/logstash/bin/logstash -f /home/palmeto/elasstic/lookup/logstash-firewall-enrich.conf < firewall.log
### beats to logstash
cd /home/palmeto/elasstic
git pull
cd filebeat
nano filebeat.yml
filebeat.inputs:
- type: log
paths:
- /home/palmeto/elasstic/filebeat/access.log
output.logstash:
hosts: ["127.0.0.1:5044"]
## run logstash
/usr/share/logstash/bin/logstash -f /home/palmeto/elasstic/filebeat/logstash-filebeat.conf
## createa new putty session
sudo su
cd elasstic/filebeat/
apt install filebeat
/usr/share/filebeat/bin/filebeat -c /home/palmeto/elasstic/filebeat/filebeat.yml