The parsing tag has no wiki summary.
0
votes
1answer
43 views
Parse Apache logfile and ban IPs
My server is under attack, it is flooded with request with the following pattern:
Thousands of IPs
Each IP request the same page "GET / HTTP/1.1" with the same referrer 3-5 times per second (same ...
1
vote
2answers
71 views
Scripts or tools to parse email message to remove attachment of particular name
I have configured Redmine email integration and while it's awesome, a major annoyance is that people have signatures that include a company logo, which then gets posted to every ticket they update via ...
2
votes
1answer
52 views
How to handle many daily emails from cron efficiently?
With each new server comes at least one more daily crontab email. The FreeBSD servers even send two: a daily and a security run output. Thanks to my obsession with virtualisation the number of emails ...
-4
votes
2answers
157 views
How can I limit the output of the whois command?
How do I get only the owner/orgname from a PTR whois lookup?
I don't need all the other entires, just the part about ownership (google in this case).
Edit /usr/bin/whois 74.125.236.52 or any ip
...
0
votes
1answer
151 views
Shell script to parse ip:port from a text file
I get daily a text file with ip:port, one per line, example:
11.22.33.44:80
22.33.44.55:8080
33.44.55.66:7777
I would like to parse the first ip and port in two different variables, then write them ...
5
votes
3answers
55 views
Discover intended Foreign Keys from JOINS in scripts
I'm inheriting a database that has 400 tables and only 150 foreign key constraints registered. Knowing what I do about the application and looking at the table columns, it's easy to say that there ...
2
votes
2answers
1k views
Having difficulty getting multi-line Powershell regex to work - no matches
I referred to several examples I was able to search, which seemed highly pertinent, but am still unable to get this to work.
My input looks like this, from a dhcp server stats command, and I've ...
12
votes
3answers
8k views
How do I grep through binary files that look like text?
I have binary files that should be text (they're exported logs), but I can't open it with less (it looks ugly - it looks like a binary file). I found that I could open it with vi and I can cat it ...
0
votes
1answer
292 views
Bash getops: allow, but not require arg
I'm writing a bash script, parsing options with getopts like this:
#!/bin/bash
while getopts ab: ; do
case $opt in
a) AOPT=1
;;
b) BOPT=$OPTARG
...
1
vote
1answer
65 views
Obtain Bacula status in parseable format
Is it possible to obtain the status of Bacula Director in some parseable format?
It looks like the human-readable representation (one you can see when using bacula-console) is formed on the director ...
2
votes
5answers
256 views
Check availability of my websites
How can I check the availability of websites from hosted by company?
Ping the server and checking if the services for IIS or Apache/Tomcat
is not enough. I want to see if the sites are responsive, if ...
3
votes
2answers
625 views
Ways to parse NCSA combined based log files
I've done a bit of site: searching with Google on Server Fault, Super User and Stack Overflow. I also checked non site specific results and and didn't really see a question like this, so here goes...
...
1
vote
1answer
429 views
Potential issues with tab delimited Logformat for apache 2.2x?
My employer has a CustomLog piped handler that reduces and preps the static web content machine access logs into a format that is kosher for being dumped into hadoop/hive. Unfortunately it hinges on ...
1
vote
2answers
1k views
Parse/Edit Apache conf files with Ruby?
I need to write some scripts to make changes to Apache conf files, namely to add/update VirtualHosts. I plan on doing this in Ruby. before I write my own, are there any scripts/rubygems which allow ...
4
votes
1answer
661 views
2
votes
5answers
2k views
Get list of user-agents from nginx log
I have nginx log file, and I want to find out market share for each major version of browsers. I am not interested in minor versions and operating systems. I would like to get something like this:
...
0
votes
2answers
365 views
Possible interface types that may show up in “ip addr show”?
Consider the output of a typical ip addr show on Linux:
# ip addr show
1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet ...
33
votes
11answers
28k views
Do you have any useful awk and grep scripts for parsing apache logs?
I can use log analyzers, but often I need to parse recent web logs to see what's happening at the moment.
I sometimes do things like to figure out top 10 ips that request a certain file
cat foo.log ...