-
Notifications
You must be signed in to change notification settings - Fork 1
/
indexs.php
77 lines (71 loc) · 4.08 KB
/
indexs.php
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
<?php
/*
License:
"Remote Syslog" is a free application what can be used to view syslog messages.
Copyright (C) 2017 Tom Slenter
This program 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 3 of the License.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
For more information contact the author:
Name author: Tom Slenter
E-mail: info@remotesyslog.com
*/
?>
<html>
<head>
<title>Remote Syslog: v1.1.3.3</title>
</head>
<body bgcolor="#000000"; style="color:#00FF00">
</script>
<div style="width:100%;">
<?php echo "<font color=\"white\">Remote Syslog v1.1.3.3 by T.Slenter<br>More info: </font>"; ?><a href="https://www.remotesyslog.com/" target="_blank" style="color: #FFFF00">https://www.remotesyslog.com/</a>
<hr width="100%" noshade></hr>
<div style="float:left; width:100%; color:#FFFFFF;" >
<?php if (isset($_POST['button4'])) { header('Location: remote_syslog'); } ?>
<?php if (isset($_POST['button1'])) { exec('logger -n 127.0.0.1 -d "This is a UDP test message!"; logger -T -P 514 -n 127.0.0.1 "This is a TCP test message!"'); } ?>
<?php if (isset($_POST['button2'])) { exec('rm -rf /var/log/remote_syslog/remote_syslog.log.*'); } ?>
<?php if (isset($_POST['button3'])) { header('Location: https://www.remotesyslog.com/License'); } ?>
<?php if (isset($_POST['button10'])) { header('Location: index.php'); } ?>
<form action="/index.php" method="post">
Search live logging: <input type="text" style="width:150px; height:24px; margin-right:5;" name="data" />
<input type="submit" name="submit" formaction="/indexs.php" style="width:150px; height:24px; margin-right:5;" value="Search" /> <button type="submit" name="button10" style="width:150px; height:24px; margin-right:5;">Live logging</button>
<button type="submit" name="button4" style="width:150px; height:24px; margin-right:5;">Syslog archive</button>
<button type="submit" name="button1" style="width:150px; height:24px; margin-right:5;">Send test message</button>
<button type="submit" name="button2" style="width:150px; height:24px; margin-right:5;">Clear live log archive</button>
<button type="submit" name="button3" style="width:150px; height:24px;">License</button>
<hr width="100%" noshade></hr>
</form>
</div>
<div style="overflow: scroll; height: 507px; width: 100%;" >
<pre><?php
$search = $_POST['data'];
$lines = file('/var/log/remote_syslog/remote_syslog.log');
$found = false;
foreach($lines as $line)
{
if(strpos($line, $search) !== false)
{
$found = true;
echo $line;
}
}
if(!$found)
{
echo 'No match found, search is case-sensitive';
}
?></pre>
</div>
<hr width="100%" noshade></hr>
<?php echo "<font color=\"white\"></font>"; ?>
</div>
<div align="center">
<?php echo "<font color=\"white\">Search completed!</font><br>"; ?>
</div>
</body>
</html>