Stats for Telegram
- Python (tested with 3.7)
- Elasticsearch (tested with 6.2.4)
- Kibana (tested with 6.2.4)
- Filebeat (tested with 6.2.4)
-
Fill in your Telegram account details into
telegram.ini
. -
Run
messages.py
and redirect its output to a file:
PYTHONUNBUFFERED=1 python messages.py > messages.log
Note: You need to run messages.py
at least once first to set up your Telegram session on a new device with the code that will be sent to you.
-
Start Elasticsearch
-
Modify
filebeat.yml
and add your message log path underpaths
for the log input:
# Paths that should be crawled and fetched. Glob based paths.
paths:
- /path/to/your/log/file
- Start Filebeat and set the config path to the
tgrm
folder:
filebeat -e --path.config $PWD
The -e
flag tells Filebeat to log to standard error.
-
Start Kibana.
-
Inside Kibana, create an index pattern for
filebeat-
, selectingtimestamp
as the Time Filter field name. -
After creating a new index pattern, go to the "Management" tab and select "Index Patterns". The ID of the newly-created index pattern will be in the address bar just behind
indices/
. Copy it. -
Inside
visualisations.json
, replace all IDs underkibanaSavedObjectMeta.searchSourceJSON.index
with your index ID. -
Go to "Saved Objects" under the "Management" tab and import your modified
visualisations.json
anddashboard.json
.