Skip to content

Instantly share code, notes, and snippets.

@portante
Created May 29, 2017 12:26
Show Gist options
  • Select an option

  • Save portante/f20a20595166aa786c167d4b1e3cc6ac to your computer and use it in GitHub Desktop.

Select an option

Save portante/f20a20595166aa786c167d4b1e3cc6ac to your computer and use it in GitHub Desktop.
A simple script to dump the logs through a filter (format-es-logs gist)
#!/bin/bash
ES_URL='https://localhost:9200'
curl_get='curl -s -X GET --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key'
$curl_get $ES_URL/<index>/_search"?pretty&sort=@timestamp:desc&fields=@timestamp,kubernetes.host,kubernetes.pod_name,message" | ./format-es-logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment