Skip to main content

TEMP

/****** başarılı başarısız çağrı dağılımı işletim sistemi versiyonu sorgusu  ******/
SELECT TOP (1000)
	COUNT(*) CallCount,
	COUNT(DISTINCT cac.[Value]) AS DistinctCustomers,
	ca.[Value] AS OSName,
	cav.[Value] AS OSVersion,
	CASE WHEN cev.CallEventTypeId IS NULL THEN 0 ELSE 1 END AS Successfull

FROM [cceasyconprd175].[dbo].[Call] c
INNER JOIN CallAttribute ca ON ca.Name = 'OSName' AND ca.[Value] = 'ANDROID' AND  ca.CallId = c.Id
INNER JOIN CallAttribute cav ON cav.Name = 'OSVersion' AND  cav.CallId = c.Id
INNER JOIN CallAttribute cac ON cac.Name = 'CustomerId' AND  cac.CallId = c.Id
INNER JOIN CallEvent cev_pickup ON cev_pickup.CallEventTypeId = 3 AND  cev_pickup.CallId = c.Id
LEFT JOIN CallEvent cev ON cev.CallEventTypeId = 6 AND  cev.CallId = c.Id


GROUP BY ca.[Value] , cav.[Value] ,cev.CallEventTypeId

ORDER BY COUNT(*) DESC

 

 

/****** İşletim sistemi dağılım chartı  ******/
SELECT TOP (1000)
	COUNT(*) CallCount,
	COUNT(DISTINCT cac.[Value]) AS DistinctCustomers,
	ca.[Value] AS OSName,
	cav.[Value] AS OSVersion

FROM [cceasyconprd175].[dbo].[Call] c
INNER JOIN CallAttribute ca ON ca.Name = 'OSName' AND ca.[Value] = 'ANDROID' AND  ca.CallId = c.Id
INNER JOIN CallAttribute cav ON cav.Name = 'OSVersion' AND  cav.CallId = c.Id
INNER JOIN CallAttribute cac ON cac.Name = 'CustomerId' AND  cac.CallId = c.Id

GROUP BY ca.[Value] , cav.[Value] 

ORDER BY COUNT(*) DESC

 

 

{"type":"candidate","label":0,"id":"0","candidate":"candidate:72048312 1 udp 2122260224 10.55.35.125 55900 typ host generation 0 ufrag 4zWE network-id 2 network-cost 10"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":1,"id":"1","candidate":"candidate:654065253 1 udp 41820927 193.254.229.194 57441 typ relay raddr 10.5.20.134 rport 57866 generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":1,"id":"1","candidate":"candidate:764936238 1 udp 41820415 193.254.229.218 50361 typ relay raddr 10.5.20.134 rport 57866 generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":2,"id":"2","candidate":"candidate:764936238 1 udp 41820415 193.254.229.218 51022 typ relay raddr 10.5.20.134 rport 57868 generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":2,"id":"2","candidate":"candidate:654065253 1 udp 41820927 193.254.229.194 60969 typ relay raddr 10.5.20.134 rport 57868 generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":1,"id":"1","candidate":"candidate:4209084972 1 tcp 1518280447 10.55.35.125 9 typ host tcptype active generation 0 ufrag 4zWE network-id 2 network-cost 10"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":1,"id":"1","candidate":"candidate:548339063 1 tcp 1518214911 10.5.20.134 9 typ host tcptype active generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":2,"id":"2","candidate":"candidate:4209084972 1 tcp 1518280447 10.55.35.125 9 typ host tcptype active generation 0 ufrag 4zWE network-id 2 network-cost 10"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":2,"id":"2","candidate":"candidate:548339063 1 tcp 1518214911 10.5.20.134 9 typ host tcptype active generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":2,"id":"2","candidate":"candidate:3629574897 1 udp 25043455 193.254.229.194 62360 typ relay raddr 10.51.6.136 rport 59199 generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:3724814819 1 udp 2122194688 10.5.20.134 55902 typ host generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":1,"id":"1","candidate":"candidate:3543323834 1 udp 25042943 193.254.229.218 50257 typ relay raddr 10.51.6.136 rport 64923 generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":2,"id":"2","candidate":"candidate:3543323834 1 udp 25042943 193.254.229.218 53275 typ relay raddr 10.51.6.136 rport 61663 generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":1,"id":"1","candidate":"candidate:3629574897 1 udp 25043455 193.254.229.194 61216 typ relay raddr 10.51.6.136 rport 64116 generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:32	14sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:654065253 1 udp 41820928 193.254.229.194 61595 typ relay raddr 10.5.20.134 rport 55902 generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:33	14sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:3629574897 1 udp 25043200 193.254.229.194 57886 typ relay raddr 10.51.6.136 rport 63579 generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:33	14sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:764936238 1 udp 41820416 193.254.229.218 65210 typ relay raddr 10.5.20.134 rport 55902 generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:33	14sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:3543323834 1 udp 25042688 193.254.229.218 57422 typ relay raddr 10.51.6.136 rport 53588 generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:33	14sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:4209084972 1 tcp 1518280448 10.55.35.125 9 typ host tcptype active generation 0 ufrag 4zWE network-id 2 network-cost 10"}	03.12.2025 14:20:33	14sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:548339063 1 tcp 1518214912 10.5.20.134 9 typ host tcptype active generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:33	14sn
{"type":"candidate","label":1,"id":"1","candidate":"candidate:72048312 1 udp 2122260223 10.55.35.125 57865 typ host generation 0 ufrag 4zWE network-id 2 network-cost 10"}	03.12.2025 14:20:33	14sn
{"type":"candidate","label":1,"id":"1","candidate":"candidate:3724814819 1 udp 2122194687 10.5.20.134 57866 typ host generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:33	14sn
{"type":"candidate","label":2,"id":"2","candidate":"candidate:72048312 1 udp 2122260223 10.55.35.125 57867 typ host generation 0 ufrag 4zWE network-id 2 network-cost 10"}	03.12.2025 14:20:33	14sn
{"type":"candidate","label":2,"id":"2","candidate":"candidate:3724814819 1 udp 2122194687 10.5.20.134 57868 typ host generation 0 ufrag 4zWE network-id 1 network-cost 50"}	03.12.2025 14:20:33	14sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:430735571 1 udp 2122260223 192.168.1.102 41550 typ host generation 0 ufrag Hebi network-id 5 network-cost 10"}	03.12.2025 14:20:34	15sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:430735571 1 udp 2122194687 192.168.1.102 43416 typ host generation 0 ufrag Hebi network-id 4 network-cost 10"}	03.12.2025 14:20:34	15sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:842163049 1 udp 1685987071 88.235.232.254 56586 typ srflx raddr 192.168.1.102 rport 43416 generation 0 ufrag Hebi network-id 4 network-cost 10"}	03.12.2025 14:20:34	15sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:842163049 1 udp 1686052607 88.235.232.254 56298 typ srflx raddr 192.168.1.102 rport 41550 generation 0 ufrag Hebi network-id 5 network-cost 10"}	03.12.2025 14:20:34	15sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:1012018261 1 udp 41820159 193.254.229.194 63816 typ relay raddr 88.235.232.254 rport 56586 generation 0 ufrag Hebi network-id 4 network-cost 10"}	03.12.2025 14:20:34	15sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:295330129 1 udp 41820671 193.254.229.218 62796 typ relay raddr 88.235.232.254 rport 56586 generation 0 ufrag Hebi network-id 4 network-cost 10"}	03.12.2025 14:20:34	15sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:1595514273 1 udp 25043199 193.254.229.218 57896 typ relay raddr 88.235.232.254 rport 55799 generation 0 ufrag Hebi network-id 4 network-cost 10"}	03.12.2025 14:20:34	15sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:1926353061 1 udp 25042687 193.254.229.194 51255 typ relay raddr 88.235.232.254 rport 56085 generation 0 ufrag Hebi network-id 4 network-cost 10"}	03.12.2025 14:20:34	15sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:1012018261 1 udp 41885695 193.254.229.194 56219 typ relay raddr 88.235.232.254 rport 56298 generation 0 ufrag Hebi network-id 5 network-cost 10"}	03.12.2025 14:20:34	15sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:295330129 1 udp 41886207 193.254.229.218 51001 typ relay raddr 88.235.232.254 rport 56298 generation 0 ufrag Hebi network-id 5 network-cost 10"}	03.12.2025 14:20:34	15sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:1926353061 1 udp 25108223 193.254.229.194 56982 typ relay raddr 88.235.232.254 rport 55465 generation 0 ufrag Hebi network-id 5 network-cost 10"}	03.12.2025 14:20:34	15sn
{"type":"candidate","label":0,"id":"0","candidate":"candidate:1595514273 1 udp 25108735 193.254.229.218 61867 typ relay raddr 88.235.232.254 rport 56141 generation 0 ufrag Hebi network-id 5 network-cost 10"}


SELECT
cv.[Date],
cv.AgentId,
AVG(cv.AgentLoadingSeconds)

FROM (
SELECT 
Id,
RtcId,
AgentId,
CONCAT(DATEPART(YEAR, c.CreatedAt), '-', DATEPART(MONTH, c.CreatedAt), '-' , DATEPART(DAY, c.CreatedAt)) AS Date,
CreatedAt,

DATEDIFF(SECOND, (SELECT TOP 1 CreatedAt FROM CallEvent ce WHERE ce.CallId = c.Id AND ce.CallEventTypeId = 3), (SELECT TOP 1 CreatedAt FROM CallEvent ce WHERE ce.CallId = c.Id AND ce.CallEventTypeId = 4))  AS AgentLoadingSeconds


FROM Call c
WHERE AgentId IS NOT NULL

AND (SELECT TOP 1 CreatedAt FROM CallEvent ce WHERE ce.CallId = c.Id AND ce.CallEventTypeId = 3) IS NOT NULL
AND (SELECT TOP 1 CreatedAt FROM CallEvent ce WHERE ce.CallId = c.Id AND ce.CallEventTypeId = 4) IS NOT NULL
) cv

WHERE cv.CreatedAt > '2025-10-1 00:00:00' AND cv.CreatedAt < '2026-10-1 00:00:00'

GROUP BY Date, AgentId





SELECT
cv.[Date],
cv.AgentId,
AVG(cv.AgentLoadingSeconds)

FROM (
SELECT 
Id,
RtcId,
AgentId,
CONCAT(DATEPART(YEAR, c.CreatedAt), '-', DATEPART(MONTH, c.CreatedAt), '-' , DATEPART(DAY, c.CreatedAt)) AS Date,
CreatedAt,

DATEDIFF(
SECOND, 
(SELECT TOP 1 CreatedAt FROM CallEvent ce WHERE ce.CallId = c.Id AND ce.CallEventTypeId = 3), 
(SELECT TOP 1 CreatedAt FROM CallConnectionEvent cce WHERE cce.CallId = c.Id AND cce.ConnectionEvent = 'SENT-OFFER'))  
AS AgentLoadingSeconds


FROM Call c
WHERE AgentId IS NOT NULL

AND (SELECT TOP 1 CreatedAt FROM CallEvent ce WHERE ce.CallId = c.Id AND ce.CallEventTypeId = 3) IS NOT NULL
AND (SELECT TOP 1 CreatedAt FROM CallEvent ce WHERE ce.CallId = c.Id AND ce.CallEventTypeId = 4) IS NOT NULL
) cv

WHERE cv.CreatedAt > '2025-10-1 00:00:00' AND cv.CreatedAt < '2026-10-1 00:00:00'

GROUP BY Date, AgentId


DECLARE @ErrorPercent INT
DECLARE @CountVOB INT
DECLARE @NotProcessedVOB INT
DECLARE @StartDate AS DATETIME
SET @StartDate = CAST(CAST(GETDATE() AS date) AS datetime)

SELECT 
	@CountVOB = COUNT(*),
	@NotProcessedVOB = SUM(CASE WHEN cmp.RecordingId IS NULL THEN 1 ELSE 0 END)
FROM (
		SELECT * FROM dbo.[Call] c 
		WHERE c.DurationSeconds > 30 
		AND c.CreatedAt >= @StartDate AND c.VpError = 0 AND c.CreatedAt  <= DATEADD(HOUR, 24, @StartDate) 
) cmp

-- Check for COUNT > 0 to prevent a divide-by-zero error
IF @CountVOB > 0
BEGIN
    SET @ErrorPercent = (@NotProcessedVOB * 10) / @CountVOB;
END
ELSE
BEGIN
    SET @ErrorPercent = 0;
END

Print @CountVOB;
Print @NotProcessedVOB;
Print @ErrorPercent;
 
SELECT @CountVOB AS CountVOB, @NotProcessedVOB AS NotProcessedVOB, @ErrorPercent AS ErrorPercent
GO

Ghostcall kuyruğunda olması gerekip olamayan ve çağrı kayıtları bulunan idleri aşağıda paylaşıyorum. Ayrıca örneklerin bazılarında Admin panelde kayıtlı görüşme süresiyle video kayıt sürelerinin de uyuşmaması durumu söz konusu. İncelemenizi rica ederiz.

Rtcıd: 5c250000e6625684067a08de1d06f908

Intıd: 09V5TUB90DR4KNMH

Rtcıd: 5c250000e662568477f208de1d06a92d

İntıd: 09V5TUB90DR4KNKE

 

Rtcıd:5c250000e662568449d108de1d066ec8

İntıd:09V5TUB90DR4KNJQ

Rtcıd: 5c250000e6625684396508de1d0f41cf

İntıd: 09V5TUB90DR4KP9X

Rtcld: 5c250000e66256849b4208de2111ae33

interaction ID: 09V5TUB91PV72XJK

"ENGAGE_GMS_CONNID_WAITINTERVALINMS": 700,
"ENGAGE_GMS_CONNID_TRYCOUNT":  20,


srvdobtest

uq7MUBXd9bsZsmRKVSzK

https://dob175.yapikredi.com.tr/r/b4000000568400508c5a08dd9f6b3d63?test=true

https://dob175.yapikredi.com.tr/r/b400000056840050597308dd9f6b6e7e?test=true

https://dob175.yapikredi.com.tr/r/b40000005684005002ef08dd9f6bae55?test=true

The provided YAML file is a Docker Compose configuration for setting up a complete Elastic Stack environment. To convert it into individual Docker commands, we need to break down each service and translate its configuration into corresponding Docker run arguments.

Environment Variables (.env file):

Before running the Docker commands, you'll need an .env file in the same directory with the following variables (replace placeholders with your actual values):

STACK_VERSION=8.7.0 
ES_PORT=9200
CLUSTER_NAME=elastic-cluster
ELASTIC_PASSWORD=your_elastic_password
KIBANA_PASSWORD=your_kibana_password
LICENSE=trial
ES_MEM_LIMIT=2g
KB_MEM_LIMIT=1g
APM_MEM_LIMIT=1g
KIBANA_PORT=5601
REGISTRY_PORT=8080
APM_PORT=8200
ENCRYPTION_KEY=your_encryption_key
content_copy
download
Use code with caution.

Docker Commands:

Here's the breakdown of the Docker commands for each service:

1. Elasticsearch (elastic):

# Create a named volume for Elasticsearch data
docker volume create elastic-data

# Run Elasticsearch container
docker run -d \
  --name elastic \
  -p 9200:9200 \
  -v elastic-data:/usr/share/elasticsearch/data \
  -e "node.name=elastic" \
  -e "discovery.type=single-node" \
  -e "ELASTIC_PASSWORD=HFuALIS6bHZjre9KOIId" \
  -e "xpack.security.enabled=true" \
  -e "xpack.license.self_generated.type=basic" \
  --health-cmd='curl -s http://localhost:9200 | grep -q "missing authentication credentials"' \
  --health-interval=10s \
  --health-timeout=10s \
  --health-retries=120 \
  docker.elastic.co/elasticsearch/elasticsearch:8.7.1
content_copy
download
Use code with caution.
Bash

2. Setup (setup):

This service runs once and then exits. It configures the kibana_system user's password.

docker run -d --rm \
  --network=host \
  --name setup \
  -e "ELASTIC_PASSWORD=HFuALIS6bHZjre9KOIId" \
  -e "KIBANA_PASSWORD=cZzEtfPI4TbT" \
  docker.elastic.co/elasticsearch/elasticsearch:8.7.1 \
  bash -c '
    if [ x${ELASTIC_PASSWORD} == x ]; then
      echo "Set the ELASTIC_PASSWORD environment variable in the .env file";
      exit 1;
    elif [ x${KIBANA_PASSWORD} == x ]; then
      echo "Set the KIBANA_PASSWORD environment variable in the .env file";
      exit 1;
    fi;
    echo "Waiting for Elasticsearch availability";
    until curl -s http://localhost:9200 | grep -q "missing authentication credentials"; do sleep 30; done;
    echo "Setting kibana_system password";
    until curl -s -X POST -u "elastic:${ELASTIC_PASSWORD}" -H "Content-Type: application/json" http://localhost:9200/_security/user/kibana_system/_password -d "{\"password\":\"${KIBANA_PASSWORD}\"}" | grep -q "^{}"; do sleep 10; done;
    echo "All done!";
  '
content_copy
download
Use code with caution.
Bash

Important Note: Replace <your_network_name> with the name of the network that you create below for connecting these containers. The setup container must be on the same network as the elastic container.

3. Kibana (kibana):

# Create a kibana.yml file (see below)

# Run Kibana container
docker run -d \
  --name kibana \
  -p 5601:5601 \
  -v ./kibana.yml:/usr/share/kibana/config/kibana.yml \
  -e "SERVER_NAME=kibana" \
  -e "ELASTICSEARCH_HOSTS=http://localhost:9200" \
  -e "ELASTICSEARCH_USERNAME=kibana_system" \
  -e "ELASTICSEARCH_PASSWORD=cZzEtfPI4TbT" \
  -e "XPACK_SECURITY_ENABLED=true" \
  -e "XPACK_MONITORING_ENABLED=true" \
  -e "XPACK_APM_ENABLED=true" \
  -e "XPACK_SECURITY_ENCRYPTIONKEY=c34d38b3a14956121ff2170e5030b471551370178f43e5626eec58b04a30fae2" \
  -e "XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY=c34d38b3a14956121ff2170e5030b471551370178f43e5626eec58b04a30fae2" \
  -e "XPACK_REPORTING_ENCRYPTIONKEY=c34d38b3a14956121ff2170e5030b471551370178f43e5626eec58b04a30fae2" \
  -e "xpack.fleet.registryUrl=http://localhost:8080" \
  --health-cmd='curl -s http://localhost:5601/login | grep -q "Kibana"' \
  --health-interval=10s \
  --health-timeout=10s \
  --health-retries=120 \
  --network=host \
  docker.elastic.co/kibana/kibana:8.7.1
content_copy
download
Use code with caution.
Bash

kibana.yml:

Create a file named kibana.yml with the following content:

server.host: "0" 
elasticsearch.hosts: [ "http://elastic:9200" ]
elasticsearch.username: "kibana_system"
elasticsearch.password: "${KIBANA_PASSWORD}"
xpack.fleet.registryUrl: http://registry:8080
content_copy
download
Use code with caution.
Yaml

4. Package Registry (registry):

docker run -d \
  --name registry \
  --network=host \
  -p 8080:8080 \
  --health-cmd='curl -s http://localhost:8080 | grep -q "Package Registry"' \
  --health-interval=10s \
  --health-timeout=10s \
  --health-retries=120 \
  docker.elastic.co/package-registry/distribution:lite-8.7.1
content_copy
download
Use code with caution.
Bash

5. APM Server (apm):

docker run -d \
  --name apm \
  -p 8200:8200 \
  --network=host \
  docker.elastic.co/apm/apm-server:8.7.1 \
  apm-server -e \
    -E output.elasticsearch.hosts=["localhost:9200"] \
    -E output.elasticsearch.protocol=http \
    -E output.elasticsearch.username=elastic \
    -E output.elasticsearch.password=HFuALIS6bHZjre9KOIId \
    -E apm-server.kibana.enabled=true \
    -E apm-server.kibana.host="localhost:5601" \
    -E apm-server.kibana.protocol="http" \
    -E apm-server.kibana.username="elastic" \
    -E apm-server.kibana.password="HFuALIS6bHZjre9KOIId" \
    -E apm-server.anonymous_access.enabled=true \
    -E apm-server.auth.anonymous=true \
    -E apm-server.auth.anonymous.allow_agent=["*"] \
    -E apm-server.auth.anonymous.allow_service=["*"] \
    -E apm-server.auth.anonymous.rate_limit.event_limit=10000 \
    -E apm-server.auth.anonymous.rate_limit.ip_limit=1000 \
    -E apm-server.auth.anonymous.rate_limit.window=1m \
    -E apm-server.rum.enabled=true \
    -E apm-server.rum.event_rate.limit=300 \
    -E apm-server.rum.event_rate.lru_size=300 \
    -E apm-server.rum.allow_origins=["*"] \
    -E apm-server.rum.library_pattern="node_modules|bower_components|~" \
    -E apm-server.rum.source_mapping.cache.expiration=5m \
    -E apm-server.rum.source_mapping.index_pattern="apm-*-sourcemap*" \
    -E apm-server.rum.source_mapping.enabled=true
content_copy
download
Use code with caution.
Bash

6. Create a Docker network:

docker network create <your_network_name>
content_copy
download
Use code with caution.
Bash

Execution Order:

Create the Docker network: Run the docker network create command.

Elasticsearch: Run the docker run command for Elasticsearch.

Setup: Run the docker run command for setup. Make sure to use the same network name you created in step 1. Wait for it to complete successfully.

Kibana, Registry, and APM Server: You can start these services in any order using their respective docker run commands. Use the same network name for all of them.

Important Considerations:

Network: All the services need to be on the same Docker network to communicate with each other. I've added --network=<your_network_name> to the commands, but you need to create the network first using docker network create <your_network_name>.

Dependencies: The depends_on option in Docker Compose is not directly translatable to docker run. You need to ensure the services are started in the correct order manually, as described above.

Healthchecks: The health checks are translated using the --health-* options in the docker run commands.

Resource Limits: The mem_limit is translated using the --memory option.

Ulimits: The ulimits are translated using the --ulimit option.

Error Handling: This conversion provides a basic translation. For production environments, you should add more robust error handling and potentially use scripts to manage the startup and shutdown of these containers.

Security: Review the security configurations for each service and adjust them according to your needs, especially in a production environment.

This detailed breakdown should help you run your Elastic Stack using individual Docker commands instead of Docker Compose. Remember to replace the placeholders with your actual values and adapt the commands as needed for your specific environment.
server.host: "0.0.0.0"
server.shutdownTimeout: "5s"
monitoring.ui.container.elasticsearch.enabled: true

xpack.fleet.packages:
  - name: apm
    version: "8.7.1"

xpack.fleet.registryUrl: "http://registry:8080"
# Password for the 'elastic' user (at least 6 characters)
ELASTIC_PASSWORD=HFuALIS6bHZjre9KOIId
# Password for the 'kibana_system' user (at least 6 characters)
KIBANA_PASSWORD=cZzEtfPI4TbT
# SAMPLE Predefined Key only to be used in POC environments
ENCRYPTION_KEY=c34d38b3a14956121ff2170e5030b471551370178f43e5626eec58b04a30fae2



# Version of Elastic products
STACK_VERSION=8.7.1
LICENSE=basic
CLUSTER_NAME=ecv-elastic-cluster

# port number for various services
ES_PORT=9200
KIBANA_PORT=5601
APM_PORT=8200
REGISTRY_PORT=8080

# Increase or decrease based on the available host memory (in bytes)
ES_MEM_LIMIT=1073741824
KB_MEM_LIMIT=1073741824
APM_MEM_LIMIT=1073741824
version: "3.8"

volumes:
  elastic-data:

services:
  elastic:
    image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION}
    volumes:
      - elastic-data:/usr/share/elasticsearch/data
    ports:
      - ${ES_PORT}:9200

    environment:
      - node.name=elastic
      - cluster.name=${CLUSTER_NAME}
      - discovery.type=single-node
      - ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
      - bootstrap.memory_lock=true
      - xpack.security.enabled=true
      - xpack.license.self_generated.type=${LICENSE}

    mem_limit: ${ES_MEM_LIMIT}
    ulimits:
      memlock:
        soft: -1
        hard: -1

    healthcheck:
      test: ["CMD-SHELL", "curl -s http://localhost:9200 | grep -q 'missing authentication credentials'"]
      interval: 10s
      timeout: 10s
      retries: 120

  setup:
    image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION}
    depends_on:
      - elastic
    command: >
      bash -c '
        if [ x${ELASTIC_PASSWORD} == x ]; then
          echo "Set the ELASTIC_PASSWORD environment variable in the .env file";
          exit 1;
        elif [ x${KIBANA_PASSWORD} == x ]; then
          echo "Set the KIBANA_PASSWORD environment variable in the .env file";
          exit 1;
        fi;
        echo "Waiting for Elasticsearch availability";
        until curl -s http://elastic:9200 | grep -q "missing authentication credentials"; do sleep 30; done;
        echo "Setting kibana_system password";
        until curl -s -X POST -u "elastic:${ELASTIC_PASSWORD}" -H "Content-Type: application/json" http://elastic:9200/_security/user/kibana_system/_password -d "{\"password\":\"${KIBANA_PASSWORD}\"}" | grep -q "^{}"; do sleep 10; done;
        echo "All done!";
      '

  kibana:
    image: docker.elastic.co/kibana/kibana:${STACK_VERSION}
    volumes:
      - ./kibana.yml:/usr/share/kibana/config/kibana.yml
    ports:
      - ${KIBANA_PORT}:5601
    depends_on:
      - elastic
      - setup
    mem_limit: ${KB_MEM_LIMIT}
    environment:
      - SERVER_NAME=kibana
      - ELASTICSEARCH_HOSTS=http://elastic:9200
      - ELASTICSEARCH_USERNAME=kibana_system
      - ELASTICSEARCH_PASSWORD=${KIBANA_PASSWORD}
      - XPACK_SECURITY_ENABLED=true
      - XPACK_MONITORING_ENABLED=true
      - XPACK_APM_ENABLED=true
      - XPACK_SECURITY_ENCRYPTIONKEY=${ENCRYPTION_KEY}
      - XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY=${ENCRYPTION_KEY}
      - XPACK_REPORTING_ENCRYPTIONKEY=${ENCRYPTION_KEY}
      - xpack.fleet.registryUrl=http://registry:8080

    healthcheck:
      test: ["CMD-SHELL", "curl -s http://localhost:5601/login | grep -q 'Kibana'"]
      interval: 10s
      timeout: 10s
      retries: 120

  registry:
    image: docker.elastic.co/package-registry/distribution:lite-${STACK_VERSION}
    ports:
      - ${REGISTRY_PORT}:8080
    healthcheck:
      test: ["CMD-SHELL", "curl -s http://localhost:8080 | grep -q 'Package Registry'"]
      interval: 10s
      timeout: 10s
      retries: 120

  apm:
    image: docker.elastic.co/apm/apm-server:${STACK_VERSION}
    depends_on:
      - elastic
      - setup
    ports:
      - ${APM_PORT}:8200
    mem_limit: ${APM_MEM_LIMIT}

    command: >
      apm-server -e
        -E output.elasticsearch.hosts=["elastic:${ES_PORT}"]
        -E output.elasticsearch.protocol=http
        -E output.elasticsearch.username=elastic
        -E output.elasticsearch.password=${ELASTIC_PASSWORD}

        -E apm-server.kibana.enabled=true
        -E apm-server.kibana.host="kibana:5601"
        -E apm-server.kibana.protocol="http"
        -E apm-server.kibana.username="elastic"
        -E apm-server.kibana.password="${ELASTIC_PASSWORD}"

        -E apm-server.anonymous_access.enabled=true
        -E apm-server.auth.anonymous=true
        -E apm-server.auth.anonymous.allow_agent=["*"]
        -E apm-server.auth.anonymous.allow_service=["*"]
        -E apm-server.auth.anonymous.rate_limit.event_limit=10000
        -E apm-server.auth.anonymous.rate_limit.ip_limit=1000
        -E apm-server.auth.anonymous.rate_limit.window=1m

        -E apm-server.rum.enabled=true 
        -E apm-server.rum.event_rate.limit=300 
        -E apm-server.rum.event_rate.lru_size=300 
        -E apm-server.rum.allow_origins=["*"] 
        -E apm-server.rum.library_pattern="node_modules|bower_components|~" 
        -E apm-server.rum.source_mapping.cache.expiration=5m 
        -E apm-server.rum.source_mapping.index_pattern="apm-*-sourcemap*" 
        -E apm-server.rum.source_mapping.enabled=true
listeners.tcp = none
listeners.ssl.default = 5672

ssl_options.cacertfile = /etc/rabbitmq/ca_certificate.pem
ssl_options.certfile = /etc/rabbitmq/server_certificate.pem
ssl_options.keyfile = /etc/rabbitmq/server_key.pem
ssl_options.verify = verify_peer
ssl_options.depth  = 2
ssl_options.fail_if_no_peer_cert = false
#!/bin/bash

set -e

# Get hostname from enviromant variable
HOSTNAME=$(hostname)
if [ $? -ne 0 ]; then
  echo "Error: Could not determine hostname."
  exit 1
fi

echo "Starting RabbitMQ Server For host: " $HOSTNAME

if [ ! -z "$JOIN_CLUSTER_HOST" ]; then
    echo "Starting as clıster node" $HOSTNAME "at" $JOIN_CLUSTER_HOST
    rabbitmq-server -detached
    sleep 5
    rabbitmqctl wait /var/lib/rabbitmq/mnesia/rabbit\@$HOSTNAME.pid
    rabbitmqctl stop_app
    rabbitmqctl join_cluster rabbit@$JOIN_CLUSTER_HOST
    rabbitmqctl stop
    sleep 2
fi

# Keep foreground process active ...
rabbitmq-server

kEJeXCMVy9tqdrBjHTLfzx8ZnAuPF2RKaWpbm3Ug

version: "3"
services:
  rabbitmq1:
    image: masstransit/rabbitmq
    hostname: rabbitmq1
    environment:
      - RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
      - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
      - RABBITMQ_DEFAULT_VHOST=${RABBITMQ_DEFAULT_VHOST}
    volumes:
      - ./.erlang.cookie:/var/lib/rabbitmq/.erlang.cookie
      - ./rabbitmq-entrypoint.sh:/usr/local/bin/rabbitmq-entrypoint.sh
      - ./rmq1ssl/ca_certificate.pem:/etc/rabbitmq/ca_certificate.pem
      - ./rmq1ssl/server_certificate.pem:/etc/rabbitmq/server_certificate.pem
      - ./rmq1ssl/server_key.pem:/etc/rabbitmq/server_key.pem
      - ./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
      - rmq1data:/var/lib/rabbitmq/mnesia
    entrypoint: /usr/local/bin/rabbitmq-entrypoint.sh

  rabbitmq2:
    image: masstransit/rabbitmq
    hostname: rabbitmq2
    environment:
      - JOIN_CLUSTER_HOST=rabbitmq1
      - RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
      - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
      - RABBITMQ_DEFAULT_VHOST=${RABBITMQ_DEFAULT_VHOST}
    volumes:
      - ./.erlang.cookie:/var/lib/rabbitmq/.erlang.cookie
      - ./rabbitmq-entrypoint.sh:/usr/local/bin/rabbitmq-entrypoint.sh
      - ./rmq2ssl/ca_certificate.pem:/etc/rabbitmq/ca_certificate.pem
      - ./rmq2ssl/server_certificate.pem:/etc/rabbitmq/server_certificate.pem
      - ./rmq2ssl/server_key.pem:/etc/rabbitmq/server_key.pem
      - ./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
      - rmq2data:/var/lib/rabbitmq/mnesia
    entrypoint: /usr/local/bin/rabbitmq-entrypoint.sh

  rabbitmq3:
    image: masstransit/rabbitmq
    hostname: rabbitmq3
    environment:
      - JOIN_CLUSTER_HOST=rabbitmq1
      - RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
      - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
      - RABBITMQ_DEFAULT_VHOST=${RABBITMQ_DEFAULT_VHOST}
    volumes:
      - ./.erlang.cookie:/var/lib/rabbitmq/.erlang.cookie
      - ./rabbitmq-entrypoint.sh:/usr/local/bin/rabbitmq-entrypoint.sh
      - ./rmq3ssl/ca_certificate.pem:/etc/rabbitmq/ca_certificate.pem
      - ./rmq3ssl/server_certificate.pem:/etc/rabbitmq/server_certificate.pem
      - ./rmq3ssl/server_key.pem:/etc/rabbitmq/server_key.pem
      - ./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
      - rmq3data:/var/lib/rabbitmq/mnesia
    entrypoint: /usr/local/bin/rabbitmq-entrypoint.sh

  # load balance with ngnix
  ngnix:
    image: nginx:latest
    ports:
      - 80:80
      - 5672:5672
      - 15672:15672
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf

volumes:
  rmq1data:
  rmq2data:
  rmq3data: