This file is indexed.

/usr/share/logsparser/normalizers/apache.xml is in python-logsparser 0.4-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<?xml version="1.0" encoding="UTF-8"?>
<!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
<!--                                                            -->
<!-- pylogparser - Logs parsers python library                  -->
<!-- Copyright (C) 2011 Wallix Inc.                             -->
<!--                                                            -->
<!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
<!--                                                            -->
<!-- This package is free software; you can redistribute        -->
<!-- it and/or modify it under the terms of the GNU Lesser      -->
<!-- General Public License as published by the Free Software   -->
<!-- Foundation; either version 2.1 of the License, or (at      -->
<!-- your option) any later version.                            -->
<!--                                                            -->
<!-- This package 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 Lesser General Public License for    -->
<!-- more details.                                              -->
<!--                                                            -->
<!-- You should have received a copy of the GNU Lesser General  -->
<!-- Public License along with this package; if not, write      -->
<!-- to the Free Software Foundation, Inc., 59 Temple Place,    -->
<!-- Suite 330, Boston, MA  02111-1307  USA                     -->
<!--                                                            -->
<!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
<!DOCTYPE normalizer SYSTEM "normalizer.dtd">
<normalizer name="apache"
            version="0.99"
            unicode="yes"
            ignorecase="yes"
            matchtype="match"
            appliedTo="body"
            taxonomy="web server">
    <description>
        <localized_desc language="en">Apache normalizer. This parser supports log formats defined in apache's documentation, see http://httpd.apache.org/docs/current/logs.html .</localized_desc>
        <localized_desc language="fr">Ce normaliseur analyse les logs émis par les serveurs web Apache. Seuls les formats décrits dans la documentation Apache sont supportés en standard : cf http://httpd.apache.org/docs/current/logs.html .</localized_desc></description>
    <authors>
        <author>mhu@wallix.com</author>
    </authors>
    <tagTypes>
        <tagType name="CommonTimeFormat" type="datetime">
            <description>
        <localized_desc language="en">Matches apache's common time format.</localized_desc>
        <localized_desc language="fr">Une expression correspondant au format d'horodatage par défaut d'Apache.</localized_desc></description>
            <regexp>\[\d{1,2}/.{3}/\d{4}:\d{1,2}:\d{1,2}:\d{1,2}(?: [+-]\d{4})?\]</regexp>
        </tagType>
        <tagType name="ApacheIP" type="basestring">
            <description>
        <localized_desc language="en">IP address or None.</localized_desc>
        <localized_desc language="fr">Une adresse IP, ou un champ vide.</localized_desc></description>
            <regexp>(?:(?:\d{1,3}\.){3}\d{1,3})|-</regexp>
        </tagType>
        <tagType name="ApacheNumVal" type="basestring">
            <description>
        <localized_desc language="en">Integer or float, or None.</localized_desc>
        <localized_desc language="fr">Une valeur numérique entière ou décimale, ou un champ vide.</localized_desc></description>
            <regexp>[\d.,]+|-</regexp>
        </tagType>
        <tagType name="ApacheWord" type="basestring">
            <description>
        <localized_desc language="en">DN, user name ...</localized_desc>
        <localized_desc language="fr">Un "mot", ou un champ vide.</localized_desc></description>
            <regexp>[\w.-]+|-</regexp>
        </tagType>
    </tagTypes>
    <callbacks>
        <callback name="decode_url_path">
try:
    path = value.split(' ')[1].split('?')[0]
    log['url_path'] = path
    log['method'] = value.split(' ')[0]
except:
    pass</callback>
    </callbacks>
    <patterns>
        <pattern name="apache-001">
            <description>
        <localized_desc language="en">Common Log Format.</localized_desc>
        <localized_desc language="fr">Structure des logs selon le schéma "Common Log Format".</localized_desc></description>
            <text>%h %l %u %t "%r" %&gt;s %b$</text>
            <tags>
                <tag name="source_ip" tagType="ApacheWord">
                 <description>
        <localized_desc language="en">the remote host initiating the request</localized_desc>
        <localized_desc language="fr">l'hôte distant à l'initiative de la requête</localized_desc></description>
                 <substitute>%h</substitute>
                </tag>
                <tag name="source_logname" tagType="ApacheWord">
                 <description>
        <localized_desc language="en">the remote logname used to initiate the request</localized_desc>
        <localized_desc language="fr">l'identifiant distant à l'initiative de la requête</localized_desc></description>
                 <substitute>%l</substitute>
                </tag>
                <tag name="user" tagType="ApacheWord">
                 <description>
        <localized_desc language="en">the remote user initiating the request</localized_desc>
        <localized_desc language="fr">l'utilisateur distant à l'initiative de la requête</localized_desc></description>
                 <substitute>%u</substitute>
                </tag>
                <tag name="__date" tagType="CommonTimeFormat">
                 <description>
        <localized_desc language="en">the time at which the request was issued - please note that the timezone information is not carried over</localized_desc>
        <localized_desc language="fr">la date à laquelle la requête a été émise. Veuillez noter que l'information de fuseau horaire n'est pas prise en compte</localized_desc></description>
                 <substitute>%t</substitute>
                 <callbacks>
                  <callback>dd/MMM/YYYY:hh:mm:ss</callback>
                 </callbacks>
                </tag>
                <tag name="request" tagType="Anything">
                 <description>
        <localized_desc language="en">the first line of the request</localized_desc>
        <localized_desc language="fr">la première ligne de la requête</localized_desc></description>
                 <substitute>%r</substitute>
                 <callbacks>
                    <callback>decode_url_path</callback>
                 </callbacks>
                </tag>
                <tag name="status" tagType="ApacheNumVal">
                 <description>
        <localized_desc language="en">the final status code for the request</localized_desc>
        <localized_desc language="fr">le code de statut final pour la requête</localized_desc></description>
                 <substitute>%&gt;s</substitute>
                </tag>
                <tag name="len" tagType="ApacheNumVal">
                 <description>
        <localized_desc language="en">the size of the response in bytes, including HTTP headers</localized_desc>
        <localized_desc language="fr">la taille de la réponse émise en octets, en-têtes HTTP inclus</localized_desc></description>
                 <substitute>%b</substitute>
                </tag>
            </tags>
            <examples>
                <example>
                     <text>127.0.0.1 - - [20/Jul/2009:00:29:39 +0300] "GET /index/helper/test HTTP/1.1" 200 889</text>
                     <expectedTags>
                          <expectedTag name="source_ip">127.0.0.1</expectedTag>
                          <expectedTag name="source_logname">-</expectedTag>
                          <expectedTag name="user">-</expectedTag>
                          <expectedTag name="request">GET /index/helper/test HTTP/1.1</expectedTag>
                          <expectedTag name="status">200</expectedTag>
                          <expectedTag name="len">889</expectedTag>
                          <expectedTag name="program">apache</expectedTag>
                          <expectedTag name="url_path">/index/helper/test</expectedTag>
                          <expectedTag name="method">GET</expectedTag>
                          <expectedTag name="taxonomy">web server</expectedTag>
                     </expectedTags>
                </example>
            </examples>
        </pattern>
        <pattern name="apache-002">
            <description>
        <localized_desc language="en">"Combined" Log Format.</localized_desc>
        <localized_desc language="fr">Structure des logs selon le schéma "Combined".</localized_desc></description>
            <text>%h %l %u %t "%r" %&gt;s %b "%{Referer}i" "%{User-agent}i"$</text>
            <tags>
                <tag name="source_ip" tagType="ApacheWord">
                 <description>
        <localized_desc language="en">the remote host initiating the request</localized_desc>
        <localized_desc language="fr">l'hôte distant à l'initiative de la requête</localized_desc></description>
                 <substitute>%h</substitute>
                </tag>
                <tag name="source_logname" tagType="ApacheWord">
                 <description>
        <localized_desc language="en">the remote logname used to initiate the request</localized_desc>
        <localized_desc language="fr">l'identifiant distant à l'initiative de la requête</localized_desc></description>
                 <substitute>%l</substitute>
                </tag>
                <tag name="user" tagType="ApacheWord">
                 <description>
        <localized_desc language="en">the remote user initiating the request</localized_desc>
        <localized_desc language="fr">l'utilisateur distant à l'initiative de la requête</localized_desc></description>
                 <substitute>%u</substitute>
                </tag>
                <tag name="__date" tagType="CommonTimeFormat">
                 <description>
        <localized_desc language="en">the time at which the request was issued - please note that the timezone information is not carried over</localized_desc>
        <localized_desc language="fr">la date à laquelle la requête a été émise. Veuillez noter que l'information de fuseau horaire n'est pas prise en compte</localized_desc></description>
                 <substitute>%t</substitute>
                 <callbacks>
                  <callback>dd/MMM/YYYY:hh:mm:ss</callback>
                 </callbacks>
                </tag>
                <tag name="request" tagType="Anything">
                 <description>
        <localized_desc language="en">the first line of the request</localized_desc>
        <localized_desc language="fr">la première ligne de la requête</localized_desc></description>
                 <substitute>%r</substitute>
                 <callbacks>
                    <callback>decode_url_path</callback>
                 </callbacks>
                </tag>
                <tag name="status" tagType="ApacheNumVal">
                 <description>
        <localized_desc language="en">the final status code for the request</localized_desc>
        <localized_desc language="fr">le code de statut final pour la requête</localized_desc></description>
                 <substitute>%&gt;s</substitute>
                </tag>
                <tag name="len" tagType="ApacheNumVal">
                 <description>
        <localized_desc language="en">the size of the response in bytes, including HTTP headers</localized_desc>
        <localized_desc language="fr">la taille de la réponse émise en octets, en-têtes HTTP inclus</localized_desc></description>
                 <substitute>%b</substitute>
                </tag>
                <tag name="request_header_referer_contents" tagType="Anything">
                 <description>
        <localized_desc language="en">the contents of the "Referer" request header</localized_desc>
        <localized_desc language="fr">le contenu de l'en-tête "Referer" de la requête</localized_desc></description>
                 <substitute>%{Referer}i</substitute>
                </tag>
                <tag name="useragent" tagType="Anything">
                 <description>
        <localized_desc language="en">the contents of the "User-agent" request header</localized_desc>
        <localized_desc language="fr">le contenu de l'en-tête "User-agent" de la requête</localized_desc></description>
                 <substitute>%{User-agent}i</substitute>
                </tag>
            </tags>
            <examples>
                <example>
                     <text>127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 "http://www.example.com/start.html" "Mozilla/4.08 [en] (Win98; I ;Nav)"</text>
                     <expectedTags>
                          <expectedTag name="source_ip">127.0.0.1</expectedTag>
                          <expectedTag name="source_logname">-</expectedTag>
                          <expectedTag name="user">frank</expectedTag>
                          <expectedTag name="request">GET /apache_pb.gif HTTP/1.0</expectedTag>
                          <expectedTag name="status">200</expectedTag>
                          <expectedTag name="len">2326</expectedTag>
                          <expectedTag name="program">apache</expectedTag>
                          <expectedTag name="request_header_referer_contents">http://www.example.com/start.html</expectedTag>
                          <expectedTag name="useragent">Mozilla/4.08 [en] (Win98; I ;Nav)</expectedTag>
                          <expectedTag name="url_path">/apache_pb.gif</expectedTag>
                          <expectedTag name="method">GET</expectedTag>
                          <expectedTag name="taxonomy">web server</expectedTag>
                     </expectedTags>
                </example>
            </examples>
        </pattern>
    </patterns>
    <commonTags>
        <commonTag name="program">apache</commonTag>
    </commonTags>
</normalizer>