forked from inveniosoftware/invenio
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webstat_config.py
50 lines (44 loc) · 1.6 KB
/
webstat_config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
"""Invenio WebStat Configuration."""
__revision__ = "$Id$"
from invenio.config import CFG_ETCDIR, CFG_ELASTICSEARCH_LOGGING, CFG_CERN_SITE
CFG_WEBSTAT_CONFIG_PATH = CFG_ETCDIR + "/webstat/webstat.cfg"
if CFG_CERN_SITE:
CFG_ELASTICSEARCH_EVENTS_MAP = {
"events.loanrequest": {
"_source": {
"enabled": True
},
"properties": {
"request_id": {
"type": "integer"
},
"load_id": {
"type": "integer"
}
}
}
}
else:
CFG_ELASTICSEARCH_EVENTS_MAP = {}
if CFG_ELASTICSEARCH_LOGGING:
from invenio.elasticsearch_logging import register_schema
for name, arguments in CFG_ELASTICSEARCH_EVENTS_MAP.items():
register_schema(name, arguments)