source: trunk/scripts/samhain.xsl@ 96

Last change on this file since 96 was 1, checked in by katerina, 19 years ago

Initial import

File size: 5.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3<xsl:output
4 method="html"
5 indent="yes"
6 encoding="ISO-8859-1"
7/>
8
9<xsl:variable name="date1" select="string(/logs/req_date)" />
10<xsl:variable name="machine1" select="string(/logs/req_machine)" />
11
12<xsl:template match="/">
13<html>
14 <head>
15 <title>Samhain Log</title>
16 </head>
17 <body bgcolor="black" text="white" link="0077CC" vlink="0077CC" alink="FFFFFF">
18 <center>
19 <table bgcolor="777777" border="0" cellpadding="0" cellspacing="0">
20 <tr><td><img src="samhain.png"/></td></tr>
21 <tr><td><center><h1>Logs Samhain</h1></center></td></tr>
22 </table><br/>
23 <hr/>
24 <table bgcolor="black" border="0" cellpadding="0" cellspacing="0">
25 <form action="samhain.cgi" method="post">
26 <tr>
27 <td>Date: <input type="text" name="date">
28 <xsl:attribute name="value">
29 <xsl:value-of select="$date1" />
30 </xsl:attribute>
31 </input>
32 </td>
33 <td>Machine: <input type="text" name="machine">
34 <xsl:attribute name="value">
35 <xsl:value-of select="$machine1" />
36 </xsl:attribute>
37 </input>
38 </td>
39 <td><input type="submit" value="afficher"/></td>
40 </tr>
41 </form>
42 </table><br/>
43 <hr/>
44 <table bgcolor="222222" border="1" cellpadding="1" cellspacing="5">
45 <tr bgcolor="777777">
46 <td>TYPE D'ALERTE</td>
47 <td>CHEMIN</td>
48 <td>MESSAGE</td>
49 <td>DATE</td>
50 <td>MACHINE</td>
51 </tr>
52 <xsl:apply-templates />
53 </table>
54 <hr/>
55 </center>
56 </body>
57</html>
58</xsl:template>
59
60<xsl:template match="sig">
61</xsl:template>
62
63<xsl:template match="req_date">
64</xsl:template>
65
66<xsl:template match="req_machine">
67</xsl:template>
68
69<xsl:template match="log">
70 <tr>
71 <xsl:variable name="sev1" select="@sev"/>
72 <xsl:if test='$sev1="ALRT"'>
73 <td bgcolor="orange"><xsl:value-of select="@sev"/></td>
74 </xsl:if>
75 <xsl:if test='$sev1="MARK"'>
76 <td bgcolor="blue"><xsl:value-of select="@sev"/></td>
77 </xsl:if>
78 <xsl:if test='$sev1="CRIT"'>
79 <td bgcolor="red"><xsl:value-of select="@sev"/></td>
80 </xsl:if>
81 <xsl:if test='$sev1="WARN"'>
82 <td><xsl:value-of select="@sev"/></td>
83 </xsl:if>
84 <xsl:if test='$sev1="INFO"'>
85 <td><xsl:value-of select="@sev"/></td>
86 </xsl:if>
87 <xsl:if test='$sev1="NOTE"'>
88 <td><xsl:value-of select="@sev"/></td>
89 </xsl:if>
90 <xsl:if test='$sev1="DEBG"'>
91 <td><xsl:value-of select="@sev"/></td>
92 </xsl:if>
93 <xsl:choose>
94 <xsl:when test='$sev1="RCVT"'>
95 <td bgcolor="green"><xsl:value-of select="@sev"/></td>
96 <td><xsl:value-of select="log@path"/></td>
97 <td><xsl:value-of select="log@msg"/></td>
98 <td><xsl:value-of select="log@tstamp"/></td>
99 <td><xsl:value-of select="@remote_host"/></td>
100 </xsl:when>
101 <xsl:otherwise>
102 <td><xsl:value-of select="@path"/></td>
103 <td><xsl:value-of select="@msg"/></td>
104 <td><xsl:value-of select="@tstamp"/></td>
105 <td><xsl:value-of select="@host"/></td>
106 </xsl:otherwise>
107 </xsl:choose>
108 </tr>
109</xsl:template>
110
111<xsl:template match="trail/log">
112 <xsl:if test='starts-with(@remote_host,$machine1)'>
113 <xsl:if test='starts-with(@tstamp,$date1)'>
114 <tr>
115 <xsl:variable name="sev1" select="@sev"/>
116 <xsl:if test='$sev1="ALRT"'>
117 <td bgcolor="orange"><xsl:value-of select="@sev"/></td>
118 </xsl:if>
119 <xsl:if test='$sev1="MARK"'>
120 <td bgcolor="blue"><xsl:value-of select="@sev"/></td>
121 </xsl:if>
122 <xsl:if test='$sev1="CRIT"'>
123 <td bgcolor="red"><xsl:value-of select="@sev"/></td>
124 </xsl:if>
125 <xsl:choose>
126 <xsl:when test='$sev1="RCVT"'>
127 <td bgcolor="green"><xsl:value-of select="@sev"/></td>
128 <td><xsl:value-of select="log@path"/></td>
129 <td><xsl:value-of select="log@msg"/></td>
130 <td><xsl:value-of select="log@tstamp"/></td>
131 <td><xsl:value-of select="@remote_host"/></td>
132 </xsl:when>
133 <xsl:otherwise>
134 <td><xsl:value-of select="@path"/></td>
135 <td><xsl:value-of select="@msg"/></td>
136 <td><xsl:value-of select="@tstamp"/></td>
137 <td><xsl:value-of select="@remote_host"/></td>
138 </xsl:otherwise>
139 </xsl:choose>
140 </tr>
141 <xsl:apply-templates/>
142 </xsl:if>
143 </xsl:if>
144</xsl:template>
145
146
147</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.