Skip to content

Commit 10d0276

Browse files
author
jitendar
committed
script for local docker logs
1 parent c92fbb8 commit 10d0276

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

cantabular-import/ll.sh

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/usr/bin/env bash
2+
3+
GREEN="\e[32m"
4+
RED="\e[31m"
5+
YELLOW="\033[1;33m"
6+
RESET="\e[0m"
7+
8+
CONTAINERS="cantabular-import-journey_florence_1
9+
cantabular-import-journey_dp-import-cantabular-dimension-options_1
10+
cantabular-import-journey_dp-recipe-api_1
11+
cantabular-import-journey_dp-dataset-api_1
12+
cantabular-import-journey_dp-cantabular-filter-flex-api_1
13+
cantabular-import-journey_dp-cantabular-csv-exporter_1
14+
cantabular-import-journey_dp-filter-api_1
15+
cantabular-import-journey_dp-cantabular-xlsx-exporter_1
16+
cantabular-import-journey_dp-download-service_1
17+
cantabular-import-journey_dp-import-cantabular-dataset_1
18+
cantabular-import-journey_dp-cantabular-metadata-exporter_1
19+
cantabular-import-journey_dp-api-router_1
20+
cantabular-import-journey_dp-cantabular-dimension-api_1
21+
cantabular-import-journey_dp-frontend-filter-flex-dataset_1
22+
cantabular-import-journey_dp-publishing-dataset-controller_1
23+
cantabular-import-journey_dp-population-types-api_1
24+
"
25+
# cantabular-import-journey_dp-frontend-dataset-controller_1
26+
# cantabular-import-journey_dp-cantabular-api-ext_1
27+
# cantabular-import-journey_dp-cantabular-server_1
28+
# cantabular-import-journey_babbage_1
29+
# cantabular-import-journey_dp-import-api_1
30+
# cantabular-import-journey_mongodb_1
31+
# cantabular-import-journey_zookeeper-1_1
32+
# cantabular-import-journey_the-train_1
33+
# cantabular-import-journey_vault_1
34+
# cantabular-import-journey_kowl_1
35+
# cantabular-import-journey_postgres_1
36+
# cantabular-import-journey_dp-frontend-router_1
37+
# cantabular-import-journey_dp-cantabular-metadata-service_1
38+
# cantabular-import-journey_kafka-2_1
39+
# cantabular-import-journey_kafka-1_1
40+
# cantabular-import-journey_kafka-3_1
41+
# cantabular-import-journey_zebedee_1
42+
# cantabular-import-journey_minio_1
43+
44+
TIME=$1
45+
PASSED_CONTAINERS=$2
46+
47+
if [ "$1" = "--help" ] | [ -z "$TIME" ]
48+
then
49+
echo ""
50+
echo "This will pull lines matching 'error' or 'DATA RACE' from docker logs for all the containers in the script"
51+
echo ""
52+
echo "param 1: number of min since logs to be displayed"
53+
echo ""
54+
echo "param 2: pass the containers is you dont want to use
55+
default containers in the script"
56+
exit
57+
fi
58+
59+
if [ ! -z "$PASSED_CONTAINERS" ]
60+
then
61+
CONTAINERS="$PASSED_CONTAINERS"
62+
fi
63+
64+
65+
for container in $CONTAINERS; do
66+
67+
echo "==========================================================================="
68+
echo " "
69+
echo -e "$YELLOW logs for container : $container $RESET"
70+
echo ""
71+
# echo "time is:" $TIME'm'
72+
docker logs --since=$TIME'm' $container | egrep -B 10 -A 30 'error|DATA RACE'
73+
74+
done
75+
76+

0 commit comments

Comments
 (0)