Gawk --- produce the output in pattern space instead of END space
hi,
I'm trying to calculate IP addresses and their respective calls to our apache Server. The standard format of the input is
I'm using below given gawk code to do this ( that is accumulating all requests for all IPs in a given input file.
the problem:
input-file is actually around 47Gib in size and when I return the LINE array in END space of gawk, The process consumes all the available memory of the system and the system starts running out of memory for all other processes.
Question:
Can i return the LINE array in our pattern space rather than END space so that every IP matched is returned -- instead of adding it into array and then displaying the result.
------ Post updated at 02:16 PM ------
BTW, this code works fine for smaller file ( when I split the file into smaller chunks, which doesn't satisfy the requirement, as all the file must be scanned at once, so that I get all IPs list )
Hi....
I have a situation...I have a data file...that has space(an extra row with no data) at the end of file. I am trying to remove that spaces only if the file has a space at the end of file and if there is no space I don't want to do anything.
Can you please help me in this regards.
... (4 Replies)
Hi,
I have a txt file called a.txt which contain over 10,000 records and I would like to remove space before comma or after comma....like below:
The input (for example two record 00001,00002):
00001,client,card limited ,02292,N ,162:41 , 192, ... (6 Replies)
what can I use ??
In vi, I can use :set list <-- and see end of line $.. or use cat -A but I am wondering if there is command or program that allows me to see all the hidden characters( space, tab and etc)
Please help
thanks. (3 Replies)
cat file1|while read i
do
echo "$i"|wc
done
with this command the space in the end of the line not considered
how can solve that
for example:
read h
"hgyr "
echo "$h"|wc
4 (2 Replies)
Good afternoon! Im new at scripting and Im trying to write a script to
calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Hi
I guess this is very simple....
I want to add a space at the last line in a file.
The space has to be the last charachter on the last line, not at a new line.
Anyone ?? (7 Replies)
for eg:
i have i/p file as:
================
i
wnt
to
change end of line
=================
my require ouput is like:
i wnt to change end of line
==================== (7 Replies)
HI,
I need the help from the experts like I have created one file with text like:
Code:
a b c de f g hi j k l
So my question is that i have to write the script in which like in the first sentence it will take only one space after d and remove all the extra space in the end.I dont... (0 Replies)
I need to read in the string from input file and reform it by cut each segment and check the last segement lenght. If the last segment length is not as expected (see below segment file or table. It is predefined), then pad enough space.
Old string
FU22222222CA6666666666AKxvbFMddreeadBP999... (11 Replies)
Hi,
I have simply made a shell script to convert *.csv to *.xml file. Xml file is required for input to one tool. But i am getting space after last field. How can i remove it.
Shell script is as follows :-
if
then
echo ""
echo "Wrong syntax, Databse_update.sh... (6 Replies)
Discussion started by: stillrules
6 Replies
LEARN ABOUT DEBIAN
log::agent::channel
Agent::Channel(3pm) User Contributed Perl Documentation Agent::Channel(3pm)NAME
Log::Agent::Channel - ancestor class for all Log::Agent channels
SYNOPSIS
@Log::Agent::Channel::XXX::ISA = qw(Log::Agent::Channel);
DESCRIPTION
The "Log::Agent::Channel" class is the root class from which all "Log::Agent" channels inherit. It is a deferred class, meaning that it
cannot be instantiated directly. All the deferred routines need to be implemented by its heirs to form a valid driver.
Internally, the various "Log::Agent::Driver" objects create "Log::Agent::Channel" instances for each logging channel defined at driver
creation time. The channels are therefore architecturally hidden within "Log::Agent", since this module only provides redefined mappings
for the various logxxx() routines (logerr(), logwarn(), logdie(), etc...).
However, this does not mean that channel classes cannot be used externally: the "Log::Agent::Logger" extension makes "Log::Agent::Channel"
objects architecturally visible, thereby offering an application-level logging API that can be redirected to various places transparently
for the application.
CHANNEL LIST
The following channels are currently made available by "Log::Agent". More channels can be defined by the "Log::Agent::Logger" extension:
Log::Agent::Channel::File
This channel writes logs to files, defined by their path or via a magical opening sequence such as "|cmd". See
Log::Agent::Channel::File.
Log::Agent::Channel::Handle
This channel writes logs to an already opened descriptor, as specified by its file handle: an IO::Handle object, or a GLOB reference
such as *FILE. See Log::Agent::Channel::Handle.
Log::Agent::Channel::Syslog
This channel redirects logs to the syslogd(8) daemon, which will then handle the dispatching to various logfiles, based on its own
configuration. See Log::Agent::Channel::Syslog.
INTERFACE
You need not read this section if you're only using "Log::Agent". However, if you wish to implement another channel, then this section
might be of interest.
The following routines are deferred and therefore need to be defined by the heir:
write($priority, $logstring)
Emit the log entry held in $logstring, at priority $priority. A trailing "
" is added to the $logstring, if needed (i.e. if the
physical entity does not do it already, like syslog does).
The $priority argument must be a valid syslog priority, i.e. one of the following strings: "emerg", "alert", "crit", "err", "warning",
"notice", "info", "debug".
The $logstring may not really be a plain string. It can actually be a Log::Agent::Message object with an overloaded stringification
routine, so the illusion should be complete.
close
Close the channel.
make
This is the creation routine. Its signature varies for each channel, naturally.
AUTHOR
Raphael Manfredi <Raphael_Manfredi@pobox.com>
SEE ALSO Log::Agent::Channel::File(3), Log::Agent::Channel::Handle(3), Log::Agent::Channel::Syslog(3), Log::Agent::Logger(3).
perl v5.10.0 2002-03-09 Agent::Channel(3pm)