Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
S
stats-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
stats-facil
Validations
be54440c
Valider
be54440c
rédigé
11 years ago
par
cbay
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
import_logs: added include_path options.
parent
a163b75a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
misc/log-analytics/import_logs.py
+20
-0
20 ajouts, 0 suppression
misc/log-analytics/import_logs.py
avec
20 ajouts
et
0 suppression
misc/log-analytics/import_logs.py
+
20
−
0
Voir le fichier @
be54440c
...
@@ -377,6 +377,14 @@ class Configuration(object):
...
@@ -377,6 +377,14 @@ class Configuration(object):
'
--exclude-path-from
'
,
dest
=
'
exclude_path_from
'
,
'
--exclude-path-from
'
,
dest
=
'
exclude_path_from
'
,
help
=
"
Each line from this file is a path to exclude
"
help
=
"
Each line from this file is a path to exclude
"
)
)
option_parser
.
add_option
(
'
--include-path
'
,
dest
=
'
included_paths
'
,
action
=
'
append
'
,
default
=
[],
help
=
"
Paths to include. Can be specified multiple times. If not specified, all paths are included.
"
)
option_parser
.
add_option
(
'
--include-path-from
'
,
dest
=
'
include_path_from
'
,
help
=
"
Each line from this file is a path to include
"
)
option_parser
.
add_option
(
option_parser
.
add_option
(
'
--useragent-exclude
'
,
dest
=
'
excluded_useragents
'
,
'
--useragent-exclude
'
,
dest
=
'
excluded_useragents
'
,
action
=
'
append
'
,
default
=
[],
action
=
'
append
'
,
default
=
[],
...
@@ -510,6 +518,12 @@ class Configuration(object):
...
@@ -510,6 +518,12 @@ class Configuration(object):
if
self
.
options
.
excluded_paths
:
if
self
.
options
.
excluded_paths
:
logging
.
debug
(
'
Excluded paths: %s
'
,
'
'
.
join
(
self
.
options
.
excluded_paths
))
logging
.
debug
(
'
Excluded paths: %s
'
,
'
'
.
join
(
self
.
options
.
excluded_paths
))
if
self
.
options
.
include_path_from
:
paths
=
[
path
.
strip
()
for
path
in
open
(
self
.
options
.
include_path_from
).
readlines
()]
self
.
options
.
included_paths
.
extend
(
path
for
path
in
paths
if
len
(
path
)
>
0
)
if
self
.
options
.
included_paths
:
logging
.
debug
(
'
Included paths: %s
'
,
'
'
.
join
(
self
.
options
.
included_paths
))
if
self
.
options
.
hostnames
:
if
self
.
options
.
hostnames
:
logging
.
debug
(
'
Accepted hostnames: %s
'
,
'
,
'
.
join
(
self
.
options
.
hostnames
))
logging
.
debug
(
'
Accepted hostnames: %s
'
,
'
,
'
.
join
(
self
.
options
.
hostnames
))
else
:
else
:
...
@@ -1399,6 +1413,12 @@ class Parser(object):
...
@@ -1399,6 +1413,12 @@ class Parser(object):
for
excluded_path
in
config
.
options
.
excluded_paths
:
for
excluded_path
in
config
.
options
.
excluded_paths
:
if
fnmatch
.
fnmatch
(
hit
.
path
,
excluded_path
):
if
fnmatch
.
fnmatch
(
hit
.
path
,
excluded_path
):
return
False
return
False
# By default, all paths are included.
if
config
.
options
.
included_paths
:
for
included_path
in
config
.
options
.
included_paths
:
if
fnmatch
.
fnmatch
(
hit
.
path
,
included_path
):
return
True
return
False
return
True
return
True
@staticmethod
@staticmethod
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter