This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
export DISPLAY=:0.0 | |
# AWS S3 Bucket Details | |
AWS_BUCKET="" | |
AWS_REGION="" | |
# Export AWS credentials or use AWS profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": "ec2:*", | |
"Effect": "Allow", | |
"Resource": "*" | |
}, | |
{ | |
"Effect": "Allow", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws iam create-group --group-name eks_admin | |
ADMIN_GROUP_POLICY=$(echo -n '{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowAssumeOrganizationAccountRole", | |
"Effect": "Allow", | |
"Action": "sts:AssumeRole", | |
"Resource": "arn:aws:iam::'; echo -n "$ACCOUNT_ID"; echo -n ':role/eks_admin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POLICY=$(echo -n '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::'; echo -n "$ACCOUNT_ID"; echo -n ':root"},"Action":"sts:AssumeRole","Condition":{}}]}') | |
echo ACCOUNT_ID=$ACCOUNT_ID | |
echo POLICY=$POLICY | |
aws iam create-role \ | |
--role-name eks_admin \ | |
--description "Kubernetes administrator role (for AWS IAM Authenticator for Kubernetes)." \ | |
--assume-role-policy-document "$POLICY" \ | |
--output text \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
rabbitmq { | |
id => "rabbitmq_logs" | |
host => "localhost" | |
port => 5672 | |
vhost => "/" | |
queue => "hello" | |
ack => false | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
file { | |
path => "/home/user/apache/logs/acess_log" | |
start_position => "beginning" | |
} | |
} | |
filter { | |
grok { | |
match => {"message" => "%{COMBINEDAPACHELOG}"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPOST -H "Content-Type: application/json" "127.0.0.1:9200/_bulk?pretty" -d ' | |
{ "create" : { "_index" : "reviews", "_id" : "1" } } | |
{ "id": "1", "client" : "Johni", "message": "I was at an event at the Garden and found Staghorn right near there so went with some friends for dinner. What a nice restaurant. The steak of course was great and the drinks were made nice and strong. Service was just as good. I would definitely suggest have dinner one night if you are in the area!!!" , "date": "2021-01-02"} | |
{ "create" : { "_index" : "reviews", "_id" : "2" } } | |
{ "id": "2", "client" : "John", "message": "Awful start to finish. went on a nice thursday night. Zero atmosphere, overpriced menu, average food." , "date": "2021-01-02"} | |
{ "create" : { "_index" : "reviews", "_id" : "3" } } | |
{ "id": "3", "client" : "Torsten", "message": "It was just awesome. Fo those who want to relax and enjoy a delicious meal in a great atmosphere, I truly recommend that restaurant." , "date": "2021-01-02"} | |
{ "create" : { "_index" : "re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT -H "Content-Type: application/json" "127.0.0.1:9200/employees?pretty" -d | |
{ | |
"mappings": { | |
"properties": { | |
"name": { | |
"type": "text", | |
"fields": { | |
"keyword": { | |
"type": "keyword", | |
"ignore_above": 256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET -H "Content-Type: application/json" "127.0.0.1:9200/calls_details_2021/_search?size=0&pretty" -d ' | |
{ | |
"aggs": { | |
"calls_per_caller_name": { | |
"terms": { | |
"field": "caller_name" | |
}, | |
"aggs": { | |
"duration_sum": { | |
"sum": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET -H "Content-Type: application/json" "127.0.0.1:9200/calls_details_2021/_search?size=0&pretty" -d ' | |
{ | |
"aggs": { | |
"calls_per_caller_name": { | |
"terms": { | |
"field": "caller_name" | |
}, | |
"aggs": { | |
"duration_sum": { | |
"sum": { |
NewerOlder