Hi all,
issue is cant see index here http://127.0.0.1:9200/_cat/indices
------------docker-compose file---------------
version: '3'
services:
elasticsearch:
container_name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.1
ports:
- "9200:9200"
environment:
- xpack.security.enabled=true
- discovery.type=single-node
- ES_JAVA_OPTS=-Xmx2g -Xms2g
volumes:
# - ./cert:/usr/share/elasticsearch/cert
- ./elasticsearch.yml:/usr/share/elasticsearch/elasticsearch.yml
kibana:
container_name: kibana
image: docker.elastic.co/kibana/kibana:7.17.1
ports:
- "5601:5601"
depends_on:
- elasticsearch
# privileged: true
volumes:
# - ./cert:/usr/share/kibana/cert
- ./kibana.yml:/usr/share/kibana/config/kibana.yml
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
- elasticsearch.username=kibana_system
- elasticsearch.password=password
# - SERVER_SSL_ENABLED=true
# - SERVER_SSL_CERTIFICATE=/usr/share/kibana/cert/elastic-certificates.crt
# - SERVER_SSL_KEY=/usr/share/kibana/cert/elastic-certificates.key
filebeat:
build:
context: ./filebeat
container_name: filebeat
command: filebeat -e -strict.perms=false
volumes:
# - ./cert:/usr/share/filebeat/cert
- /path:/app/logs/template
- /path:/app/logs/shortcode-generation
depends_on:
- elasticsearch
- kibana
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
apm-server:
image: docker.elastic.co/apm/apm-server:7.17.1
container_name: apm-server
environment:
- apm-server.host=0.0.0.0:8200
- output.elasticsearch.hosts=["http://elasticsearch:9200"]
- apm-server.instrumentation.enabled=true
- apm-server.instrumentation.environment=local
- apm-server.instrumentation.hosts=["http://localhost:8200"]
ports:
- "8200:8200"
depends_on:
- elasticsearch
volumes:
# # - ./cert:/usr/share/apm-server/cert
- ./apm-server.yml:/usr/share/apm-server/apm-server.yml
template:
network_mode: "host"
build:
context: .
dockerfile: Dockerfile
container_name: template
depends_on:
- elasticsearch
env_file:
- .env
volumes:
- /etc/hosts:/etc/hosts
- ./logs/template:/app/logs
volumes:
elasticsearch_data:
driver: local
----------filebeat.yml -----------------
name: "shortify-filebeat"
logging.metrics.enabled: true
xpack.security.enabled: true
xpack.monitoring.enabled: true
setup.ilm.enabled: true
filebeat.inputs:
-
type: log
scan_frequency: 1s
enabled: true
paths:- /app/logs/template/*.log
fields:
service: template
fields_under_root: true
json:
keys_under_root: true
overwrite_keys: true
message_key: 'message'
- /app/logs/template/*.log
-
type: log
scan_frequency: 1s
enabled: true
paths:- /app/logs/shortcode-generation/*.log
fields:
service: shortcode-generation
fields_under_root: true
json:
keys_under_root: true
overwrite_keys: true
message_key: 'message'
- /app/logs/shortcode-generation/*.log
output.elasticsearch:
hosts: ["elasticsearch:9200"]
index: "shortify"
username: "elastic"
password: "password"
setup.template:
name: 'shortify'
pattern: 'shortify-*'
enabled: true
--------------elasticsearch.yml--------------
xpack.security.enabled: true
discovery.type: single-node
network.host: 127.0.0.1
http.port: 9200
-----------kibana.yml--------------------
server.name: "kibana"
server.host: "0.0.0.0" # Bind to all network interfaces
elasticsearch.hosts: ["http://127.0.0.1:9200"]
elasticsearch.username: "kibana_system"
elasticsearch.password: "password"
xpack.security.encryptionKey: "a-z"
xpack.encryptedSavedObjects.encryptionKey: "a-z"
xpack.reporting.encryptionKey : "a-z"
xpack.security.session.idleTimeout: "1h"
xpack.security.session.lifespan: "30d"
elasticsearch.ssl.verificationMode: none
------------apm-server.yml---------------
apm-server:
host: "0.0.0.0:8200"
output.elasticsearch:
hosts: ["http://localhost:9200"]
username: "elastic"
password: "password"
instrumentation:
enabled: true
environment: "local"
hosts:
----------------i have created roles and assigned it to user also------------
curl --location 'http://localhost:9200/_xpack/security/role/filebeat_writer'
--header 'Content-Type: application/json'
--header 'Authorization: Basic ZWxhc3RpYzp2aXZhQDEyMw=='
--data '{
"cluster": ["manage_index_templates", "monitor"],
"indices": [
{
"names": [ "filebeat-","shortify-"],
"privileges": ["write","create_index"]
}
]
}'
curl --location 'http://localhost:9200/_xpack/security/user/filebeat_internal'
--header 'Content-Type: application/json'
--header 'Authorization: Basic ZWxhc3RpYzp2aXZhQDEyMw=='
--data-raw '{
"password" : "password",
"roles" : [ "filebeat_writer"],
"full_name" : "Internal Filebeat User"
}'
i am able to create role and assign it to user.
but not able to see indexes.
thanks in advance