User Tools

Site Tools


сервисы_elk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
сервисы_elk [2022/03/11 09:56]
val [Примеры запросов]
сервисы_elk [2022/03/30 08:52]
val [Сервисы ELK]
Line 2: Line 2:
  
  
 +  * [[https://​habr.com/​ru/​news/​t/​657169/​|Elastic NV — американо-голландская компания,​ основанная в 2012 году в Амстердаме,​ Нидерланды,​ ранее известная как Elasticsearch,​ прекратила продажи ПО в РФ]] [update 24.03.22]
   * [[https://​system-admins.ru/​elk-o-chem-i-zachem/​|ELK. О чем и зачем?​]]   * [[https://​system-admins.ru/​elk-o-chem-i-zachem/​|ELK. О чем и зачем?​]]
   * [[https://​codedzen.ru/​category/​uroki/​elasticsearch/​|Уроки по Elasticsearch]]   * [[https://​codedzen.ru/​category/​uroki/​elasticsearch/​|Уроки по Elasticsearch]]
Line 245: Line 246:
   }   }
 } }
-</​code><​code>​+</​code>​ 
 + 
 +Длится 3-4 минуты 
 + 
 +<​code>​
 # /​usr/​share/​logstash/​bin/​logstash-plugin install logstash-output-exec # /​usr/​share/​logstash/​bin/​logstash-plugin install logstash-output-exec
 </​code>​ </​code>​
Line 287: Line 292:
 </​code><​code>​ </​code><​code>​
 #!/bin/sh #!/bin/sh
- 
-#echo $1 >> /​tmp/​cisco-backup-config-logstash.log 
  
 #ip=$1 #ip=$1
 ip=`echo $1 | cut -d: -f2 | cut -d'​}'​ -f1` ip=`echo $1 | cut -d: -f2 | cut -d'​}'​ -f1`
  
-#​cisco_name=`getent hosts $| awk '{ print $NF }'` +#​cisco_name=`host $ip | awk '{ print $NF }' ​| cut -d. -f1
-cisco_name=`host $ip | awk '{ print $NF }' ​| cut -d. -f1`+cisco_name=`getent hosts $ip | awk '{ print $NF }'`
  
 +#echo $1 $ip $cisco_name >> /​tmp/​cisco-backup-config-logstash.log
  
 /​usr/​bin/​sshpass -p cisco /​usr/​bin/​scp ${cisco_name}:​running-config /​srv/​tftp/​${cisco_name}-running-config /​usr/​bin/​sshpass -p cisco /​usr/​bin/​scp ${cisco_name}:​running-config /​srv/​tftp/​${cisco_name}-running-config
Line 340: Line 344:
 </​code><​code>​ </​code><​code>​
 # filebeat test config -e -c /​etc/​filebeat/​filebeat.yml # filebeat test config -e -c /​etc/​filebeat/​filebeat.yml
 +...
 +Config OK
  
 systemctl enable filebeat systemctl enable filebeat
Line 368: Line 374:
  
 # filebeat setup -e # filebeat setup -e
 +  2 минуты
  
 # cat /​etc/​filebeat/​modules.d/​netflow.yml # cat /​etc/​filebeat/​modules.d/​netflow.yml
сервисы_elk.txt · Last modified: 2024/02/19 12:13 by val