-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filter server logs so as to analyse user behaviour #670
Comments
@PatGendre would this be close to what you are looking for? In general, I think you want to look at current entries for similar to: You can make the same calls using a javascript visualization framework and the REST API, or you can use the public dashboard code to run jupyter notebooks (like the ones above) once a day and generate simple static images on a website (similar to https://dashboard.canbikeco.org/) |
Would be really interested in seeing which option you go with, please share! |
@shankari that's great ! Actually I was thinking of a simple daily grep of a few expressions in the log files, that would be exploited manually by the researchers, but this notebook way is certainly more general (and shows how well designed the software is ;-) It may take a while before I can send you a screenshot with our data, but I will tell you what we do in the end :-) |
Hi @shankari I tested the notebook, and encountered an error for this instruction
`DEBUG:root:curr_query = {'$or': [{'metadata.key': 'stats/server_api_time'}], 'data.ts': {'$lte': <bound method Arrow.timestamp of <Arrow [2021-09-20T09:53:58.674905+02:00]>>, '$gte': <bound method Arrow.timestamp of <Arrow [2021-02-02T00:00:00+00:00]>>}}, sort_key = None InvalidDocument Traceback (most recent call last) ~/emission/e-mission-server/emission/storage/timeseries/builtin_timeseries.py in get_data_df(self, key, time_query, geo_query, extra_query_list, map_fn) ~/emission/e-mission-server/emission/storage/timeseries/builtin_timeseries.py in find_entries(self, key_list, time_query, geo_query, extra_query_list) ~/emission/e-mission-server/emission/storage/timeseries/builtin_timeseries.py in _get_entries_for_timeseries(self, tsdb, key_list, time_query, geo_query, extra_query_list, sort_key) ~/miniconda3/envs/emission/lib/python3.7/site-packages/pymongo/collection.py in count_documents(self, filter, session, **kwargs) ~/miniconda3/envs/emission/lib/python3.7/site-packages/pymongo/mongo_client.py in _retryable_read(self, func, read_pref, session, address, retryable, exhaust) ~/miniconda3/envs/emission/lib/python3.7/site-packages/pymongo/collection.py in _cmd(session, server, sock_info, slave_ok) ~/miniconda3/envs/emission/lib/python3.7/site-packages/pymongo/collection.py in _aggregate_one_result(self, sock_info, slave_ok, cmd, collation, session) ~/miniconda3/envs/emission/lib/python3.7/site-packages/pymongo/collection.py in _command(self, sock_info, command, slave_ok, read_preference, codec_options, check, allowable_errors, read_concern, write_concern, collation, session, retryable_write, user_fields) ~/miniconda3/envs/emission/lib/python3.7/site-packages/pymongo/pool.py in command(self, dbname, spec, slave_ok, read_preference, codec_options, check, allowable_errors, check_keys, read_concern, write_concern, parse_write_concern_error, collation, session, client, retryable_write, publish_events, user_fields, exhaust_allowed) ~/miniconda3/envs/emission/lib/python3.7/site-packages/pymongo/pool.py in command(self, dbname, spec, slave_ok, read_preference, codec_options, check, allowable_errors, check_keys, read_concern, write_concern, parse_write_concern_error, collation, session, client, retryable_write, publish_events, user_fields, exhaust_allowed) ~/miniconda3/envs/emission/lib/python3.7/site-packages/pymongo/network.py in command(sock_info, dbname, spec, slave_ok, is_mongos, read_preference, codec_options, session, client, check, allowable_errors, address, check_keys, listeners, max_bson_size, read_concern, parse_write_concern_error, collation, compression_ctx, use_op_msg, unacknowledged, user_fields, exhaust_allowed) ~/miniconda3/envs/emission/lib/python3.7/site-packages/pymongo/message.py in _op_msg(flags, command, dbname, read_preference, slave_ok, check_keys, opts, ctx) InvalidDocument: cannot encode object: <bound method Arrow.timestamp of <Arrow [2021-09-20T09:53:58.674905+02:00]>>, of type: <class 'method'> ` |
I suspect this is due to Arrow, so |
Except this Arrow exception with the timequery, the rest of the notebook seems to work fine, thanks ! (I don't have time to investigate, though...) |
I've also noticed that the API calls stored in the database contain many calls apparently not linked to e-mission (see attached result for the |
Yup, these are definitely attack probes
|
For our project in la Rochelle, France, we'd like to monitor how users actually interact with the app.
Maybe another prior or current project has done the same thing already?
The idea was to filter out the log files and extract (anonymous/aggregate) daily usage stats, i.e.
how often did users open the app ? or look at the dashboard or the journal, click on a notification, etc.
The text was updated successfully, but these errors were encountered: