Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 442 Bytes

import-to-docker-mongodb.md

File metadata and controls

25 lines (17 loc) · 442 Bytes

Import processed log to mongodb container

1. Copy file to container

docker cp access_log.json mongodb:/tmp/access_log.json

2. Import to mongodb

docker exec -it mongodb mongoimport -d ===database_name=== -c ===collection_name=== --file /tmp/access_log.json

3. Access to container's shell

docker exec -it mongodb /bin/bash

4. Delete tmp file

rm -rf /tmp/access_log.json