Event logging module is a part of the Collaboration system. This module deals with the logging of the user interaction events, such as view an article. This module works as a middleware in Django project and captures and filters the request based on the specification. The logs will be stored in elasticsearch using logstash.
- Clone the collaboration-Communities Repository by typing following command and follow the instructions to install the system.
$ git clone https://github.com/fresearchgroup/Collaboration-System.git
-
Add/replace the following lines in
.env
file to add user and password for Event API AuthorizationEVENTAPI_TOKEN_USER=<name-of-user> EVENTAPI_TOKEN_PASS=<password>
-
Generating a new Token. To generate a new Token type the following command
$ python3 manage.py generateToken --n
i. Use --r flag instead of --n for renewing the flag ii. Use --g flag to get value for the current User
-
Copy the value of the token and paste in
.env
fileEVENT_API_TOKEN=<token-generated>
-
In
.env
change the value ofLOG_TYPE
to ip address oflogstash
(see step 11 to know how to get the address of logstash). -
In
.env
change the value ofLOG_PORT
to port on whichlogstash
is running. -
In
.env
change the value ofELASTICSEARCH_ADDRESS
to ip address ofelasticsearch
(see step 11 to know how to get the address of elasticsearch). -
Run the server using the following command
$ python3 manage.py runserver
-
Running ELK Stack in docker. change to evelog-Docker folder using the following command
$ cd evelog-Docker
-
Run the following command to build and start docker
$ docker-compose build $ docker-compose up
-
Getting the ip address of logstash and elasticsearch(When running on same pc). Open a new terminal window and type the following command to get the name of logstash and elasticsearch container
$ sudo docker ps
-
Once you get the name of container run the following command to inspect the docker container
$ sudo docker inspect <container-name>
-
There is a field mentioning the ip address of container. Copy it to the desired location.
-
Getting the ip address of ELK(when running on different machines). For different machines use the ip address of machine on which docker is running.