I have a log file that's created daily by this command:
It that contains data like this:
I'm not sure if there's a way to strip out the data I don't need before it logs to the file such as %nice, %iowait, and %steal. As well as the header and footer information. It would make the rest of this post irrelevant.
I need to ignore the first few rows and the last row. I also need to ignore any blank lines.
The only data I need to insert into the database is the time, %user, %system, and %idle data.
The table looks like this:
The log file name is YYYY-MM-DD_hostname_cpu.log format. I need to extract the date of the filename and insert into the table as well.
So far I have
I then needed it inserted into a mysql database. I'm assuming some type of while loop would be needed here.
Last edited by unplugme71; 08-16-2015 at 01:30 PM..
Hi....can you guys help me out in this script??
Below is a text file script....called Bukom.txt and it contains these:
BUKOM 20060101 2.5 2.6 2.7 2.8 2.9 2.3 2.1
BUKOM 20060102 2.4 2.5 2.6 2.7 2.7 2.6 2.4
BUKOM 20060103 2.1 ... (9 Replies)
Hi,
Need to get help from you guys about this issue.
I need to insert data into MySql database from a text file which is located in other server.
The text file is something look like below:
Date | SubscriberNo | Call Duration
20/7/07 | 123456788 | 20
20/7/07 | 123412344 | 30
The... (4 Replies)
Hi....can you guys help me out in this script??
Below is a text file and it contains these:
GEF001 000093625 MKL002510 000001 000000 000000 000000 000000 000000 000001
GEF001 000093625 MKL003604 000001 000000 000000 000000 000000 000000 000001
GEF001 000093625 MKL005675 000001... (4 Replies)
Hi All,
I have a file like this,
data1,data2,,,data5,data6.
i want to write a shell script to replace data3 with "/example/string". which means my data file should look like this .
data1,data2,example/string],,data5,data6.
Could you guys help me to get a sed command or any other command... (8 Replies)
Hi Guys
I need to have a shell script which reads a log file and insert a part of each line into the database. Some sample lines in the file are as below.
20091112091359 MED_RQACK : user_data=60173054304,100232120,20091112091359,;ask_status=0;ask_reason=OK;msg_id=20091112091319... (5 Replies)
If you have a text file and if you want to Insert data to your Database Table, You can do it with these queries
LOAD DATA LOCAL INFILE '/path/yourTextFile.txt' INTO TABLE yourTableName
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n' (0 Replies)
Enclosed is comma separated text file. I need to write a korn shell program that will parse the text file and insert the values into Oracle database.
I need to write the korn shell program on Red Hat Enterprise Linux server.
Oracle database is 10g. (15 Replies)
Hello All:
We are looking to search through 2000 files with around 21,000 statements where we have to search, replace and insert a pattern based on the following:
1) Parse through the file and check for CREATE MULTISET TABLE or CREATE SET TABLE statements.....and they always end with ON... (5 Replies)
I have a test file that I want to read and insert only certain lines into the
the table based on a filter.
1. Rread the log file 12 Hours back Getdate() -12 Hours
2. Extract the following information on for lines that say "DUMP is
complete"
A. Date
B. Database Name
C.... (2 Replies)
Hi Experts,
I have a situation where I need to write a shell script to continuously monitor a log directory with multiple log files and perform following:
1. Read the latest log file continuously and grep "Success" OR "Failure"
2. As it capture either Success or Failure, it has to perform a... (1 Reply)
Discussion started by: rish_max
1 Replies
LEARN ABOUT REDHAT
scrollkeeper-rebuilddb
SCROLLKEEPER-REBUILDDB(8) System Manager's Manual SCROLLKEEPER-REBUILDDB(8)NAME
scrollkeeper-rebuilddb - rebuild the scrollkeeper document catalog database
SYNOPSIS
scrollkeeper-rebuilddb [-p path ] [-v] [-q]
DESCRIPTION
This rebuilds the ScrollKeeper database from the original OMF metadata files and documents. Under normal situations, this tool is not nec-
essary. It is useful however if the database becomes corrupt, which could be caused by interruption of ScrollKeeper during an update of
the database.
Errors and warnings are logged to /var/log/scrollkeeper.log.
OPTIONS -p path
Use path as the ScrollKeeper database directory.
-v Verbose. Show warnings and error messages in addition to logging them to /var/log/scrollkeeper.log.
-q Run in quiet mode, suppressing output of all but the most serious warning and error messages to STDOUT. Note that most output to
the log file will be unchanged.
FILES
/var/lib/scrollkeeper/scrollkeeper_docs
/var/lib/scrollkeeper/TOC/<docnumber>
/var/lib/scrollkeeper/<locale>/scrollkeeper_cl.xml
/var/lib/scrollkeeper/<locale>/scrollkeeper_extended_cl.xml
/var/log/scrollkeeper.log
AUTHOR
Laszlo Kovacs <laszlo.kovacs@sun.com>
Dan Mueth <d-mueth@uchicago.edu>
SEE ALSO scrollkeeper-config(1), scrollkeeper-gen-seriesid(1), scrollkeeper.conf(5), scrollkeeper(7), scrollkeeper-preinstall(8), scrollkeeper-
update(8)scrollkeeper Dec 5, 2001 SCROLLKEEPER-REBUILDDB(8)