Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Trying to figure out a log dump command Post 302409526 by MrEddy on Thursday 1st of April 2010 12:25:56 PM
Old 04-01-2010
Trying to figure out a log dump command

Ok so i'm relatively new at UNIX and I'm trying to figure out how to make a log dump command.

My situation is a bit odd in that I'm always looking at customers boxes and as such I can't really do much to them. So everything I do in UNIX pretty much has to be a command I can type in by hand. I can't really install any apps to do things for me or anything like that since that required modifying the customers box. So I'm limited to software on the box now. We are freebsd with Bash.

So what I'm trying to do is make a command that will pull data for a specific date and time out of a bunch of different log files in different places. Then take all that information and dump it into a single log file that I can then save and look at. Which will be a big time saver for me. So that instead of having to manually dig my way through 10 log files I can just run one command and get all the data I need made into 1 file. Then I can dig through that.

I'm sure I could just do a great big long string of.. cat /folder/file | grep 'date' >> output file.

But that would require going through the entire command each time and adjust the date and time information which is going to change constantly. So I was hoping I could find a way to use variable somehow. So that I can write the command to look at variables to determine the date and time. This way all I have to do is adjust the variables to the date and time I want and the command will work. I suspect AWK can do this but really I'm just trying to figure out what kind of ideas and options I have for doing something like this.

I would appreciate any approaches to how I could accomplish this task.

---------- Post updated at 11:25 AM ---------- Previous update was at 10:37 AM ----------

Ok so I can grep for variables which is good. And I've found how I can set the variables.
Code:
#testvariable='May'; testvariable2='june'

This will allow me to easily set any number of variables. Then I can simply grep the specific log files for date and time... Now the only snag i'm running into is I can't get multiple spaces into the date. In my logs the date is.

Apr 1

with 2 spaces not 1 and anytime I set the variable it always has 1 space. Any idea how I can get 2 spaces to work?

Last edited by Yogesh Sawant; 04-05-2010 at 09:18 AM.. Reason: added code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Dump Command in Linux

Can anybody tell me please how to use the "dump" command in Linux command. dump -0u /destination /sourcefile or device file. Please correct me. -regards -Iftikhar (1 Reply)
Discussion started by: syedifti
1 Replies

2. Filesystems, Disks and Memory

backup NetApp using dump command

I have been trying to backup my NetApp /vol/vol0 data to local tape drive. It is around 68GB. The tape I am using is DLT tape and should be able to handle 70GB data. However, dump always aborted around reaching 57~58GB data. Tape drive is attached on NetApp. 1st try to dump /vol/vol0 to... (2 Replies)
Discussion started by: yellowfish
2 Replies

3. UNIX for Dummies Questions & Answers

dump command

For ufsdump you type in a "dump level". The man command mentions levels 0-9 and gives examples. Can anyone define what each level refers to? What does a level 0 dump mean? What is a level 9 dump? What are the differences? Thanks in advance:) (1 Reply)
Discussion started by: Patman
1 Replies

4. Red Hat

Dump and restore command usage ??

Hi, I am using RHEL 4.0 I need to take backup of a directory and then restore it to some other location. For taking Backup of final directory, I am using this code: dump -0aj -f /home/vicky/final.dump /home/vicky/final/ Now, I am trying to restore this final.dump to some other... (2 Replies)
Discussion started by: vikas027
2 Replies

5. UNIX for Dummies Questions & Answers

dump command

Hi all, I am using embedded linux with my own RFS. But I want to use the dump command to try and solve some errors, but I don't know in wich package I can find the dump command. I hope someone can help me. With kind regards, Jurrian Dubbeldam (1 Reply)
Discussion started by: Jurrian
1 Replies

6. Infrastructure Monitoring

SNMP log dump

Hello Admin ( and all ) ! Am looking for real time SNMP dump messages, probably some 2 to 3 days old message for efficacy testing in SNMP protocol that is introduced. Since this ours is a real-time site is it possible to get the dumps ? Or is this something like SNMP dumps are not shared... (5 Replies)
Discussion started by: matrixmadhan
5 Replies

7. UNIX for Dummies Questions & Answers

dump command fault

im performing the dump command : dump 0uaf /dev/hdc /home an error msg appers says: DUMP: you cant update the dumpdates file while dumping a subdirectory DUMP: the entire dump is aborted can anyone help (6 Replies)
Discussion started by: semosam
6 Replies

8. Shell Programming and Scripting

Is there a command to close a program with dump?

I'm running into some problems using pkill in my scripts. I'm using a program that needs to dump. (4 Replies)
Discussion started by: ninjaaron
4 Replies

9. Shell Programming and Scripting

Help with change significant figure to normal figure command

Hi, Below is my input file: Long list of significant figure 1.757E-4 7.51E-3 5.634E-5 . . . Desired output file: 0.0001757 0.00751 0.00005634 . . . (10 Replies)
Discussion started by: perl_beginner
10 Replies

10. OS X (Apple)

Can't figure out the correct syntax for a command loading a webkit plugin

Hello, Using Bash on Mac OS X 10.7.5 (Lion). I downloaded a GrowlSafari plugin for Webkit from its GitHub page GitHub - uasi/growl-safari-bridge: GrowlSafariBridge enables arbitrary javascript (including Safari Extensions) to notify via Growl.. In the description it says that after installing for... (0 Replies)
Discussion started by: scrutinizerix
0 Replies
VIRTUOSO-T(1)															     VIRTUOSO-T(1)

NAME
virtuoso-t - OpenLink Virtuoso Opensource Server SYNOPSIS
virtuoso-t [-fcnCbDARwMKrBd] [+foreground] [+configfile arg] [+no-checkpoint] [+checkpoint-only] [+backup-dump] [+crash-dump] [+configfile arg] [+restore-crash-dump] [+wait] [+more arg] [+dumpkeys arg] [+restore-backup arg] [+backup-dirs arg] [+debug] [+pwdold arg] [+pwddba arg] [+pwddav arg] virtuoso-t [+help] DESCRIPTION
This manual page documents briefly the virtuoso-t command. This manual page was written for the Debian distribution because the original program does not have a manual page. Instead, it has docu- mentation in the 'doc' VAD package. virtuoso-t is the OpenLink Virtuoso server OPTIONS
A summary of options is included below. For a complete description, see the 'doc' VAD package. +foreground run in the foreground +configfile use alternate configuration file +no-checkpoint do not checkpoint on startup +checkpoint-only exit as soon as checkpoint on startup is complete +backup-dump dump database into the transaction log, then exit +crash-dump dump inconsistent database into the transaction log, then exit +crash-dump-data-ini specify the DB ini to use for reading the data to dump +restore-crash-dump restore from a crash-dump +wait wait for background initialization to complete +mode specify mode options for server startup (onbalr) +dumpkeys specify key id(s) to dump on crash dump (default : all) +restore-backup default backup directories +backup-dirs run in the foreground +debug Show additional debugging info +pwdold Old DBA password +pwddba New DBA password +pwddav New DAV password FILES
/etc/virtuoso/virtuoso.ini The configuration file to control the behaviour of the main instance of virtuoso-t. SEE ALSO
The programs are documented fully by the 'doc' VAD package. 17 April 2013 VIRTUOSO-T(1)
All times are GMT -4. The time now is 07:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy