- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Redirect Logs into Other file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2010 03:10 AM
тАО01-20-2010 03:10 AM
I want to create a script, which Capture the month, year from my alert database log file and redirect the output in another txt file of other location as backup logs.
If someone have this kind of Script please share with me.
Thanks in Advance.
Khalid
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2010 03:24 AM
тАО01-20-2010 03:24 AM
Re: Redirect Logs into Other file
If you are talking about some unix script, you should use the shell's redirect functions (the shell that you use in the script).
Best regards,
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2010 04:49 AM
тАО01-20-2010 04:49 AM
Re: Redirect Logs into Other file
> I want to create a script, which Capture the month, year from my alert database log file and redirect the output in another txt file of other location as backup logs.
Perhaps if you showed us your input and your desired output we could help. I assume that you know basic shell concepts.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2010 10:15 PM
тАО01-20-2010 10:15 PM
Re: Redirect Logs into Other file
Thanks for your Response
Now i am attaching a log file,Its have two month log June and July,
I want to split June and July year 2009 and redirect into another file.
I try it but its showing me only date like
Sun Jun 21 18:38:47 2009
Sun Jun 21 18:45:08 2009
Sun Jun 21 18:51:30 2009
Sun Jun 21 18:57:50 2009
Please help me to split these logs using month and year filter.
Thanks
Khalid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2010 10:19 PM
тАО01-20-2010 10:19 PM
Re: Redirect Logs into Other file
Please find below the sample of Logs file
============================================
Tue Jun 30 23:51:39 2009
Copy of datafile 28 complete to datafile copy /u02/rbkp/u01/oradata/iiris_web.dbf
checkpoint is 88164327751
Tue Jun 30 23:51:47 2009
alter database create standby controlfile as '/u02/rbkp/u01/oradata/control01.ctl.stdby' reuse
Clearing standby activation ID 3180359789 (0xbd90706d)
The primary database controlfile was created using the
'MAXLOGFILES 255' clause.
There is space for up to 245 standby redo logfiles
Use the following SQL commands on the standby database to create
standby redo logfiles that match the primary database:
ALTER DATABASE ADD STANDBY LOGFILE 'srl1.f' SIZE 104857600;
ALTER DATABASE ADD STANDBY LOGFILE 'srl2.f' SIZE 104857600;
ALTER DATABASE ADD STANDBY LOGFILE 'srl3.f' SIZE 104857600;
ALTER DATABASE ADD STANDBY LOGFILE 'srl4.f' SIZE 104857600;
ALTER DATABASE ADD STANDBY LOGFILE 'srl5.f' SIZE 104857600;
ALTER DATABASE ADD STANDBY LOGFILE 'srl6.f' SIZE 104857600;
ALTER DATABASE ADD STANDBY LOGFILE 'srl7.f' SIZE 104857600;
ALTER DATABASE ADD STANDBY LOGFILE 'srl8.f' SIZE 104857600;
ALTER DATABASE ADD STANDBY LOGFILE 'srl9.f' SIZE 104857600;
ALTER DATABASE ADD STANDBY LOGFILE 'srl10.f' SIZE 104857600;
ALTER DATABASE ADD STANDBY LOGFILE 'srl11.f' SIZE 104857600;
Completed: alter database create standby controlfile as '/u02
Tue Jun 30 23:53:56 2009
Errors in file /ora/app/oracle/admin/kic/bdump/kic1_arc0_1042007.trc:
ORA-12541: TNS:no listener
Tue Jun 30 23:59:02 2009
Errors in file /ora/app/oracle/admin/kic/bdump/kic1_arc0_1042007.trc:
ORA-12541: TNS:no listener
Wed Jul 1 00:00:03 2009
Errors in file /ora/app/oracle/admin/kic/bdump/kic1_arc0_1042007.trc:
ORA-12541: TNS:no listener
Wed Jul 1 00:05:09 2009
Errors in file /ora/app/oracle/admin/kic/bdump/kic1_arc0_1042007.trc:
ORA-12541: TNS:no listener
Wed Jul 1 00:10:17 2009
Errors in file /ora/app/oracle/admin/kic/bdump/kic1_arc0_1042007.trc:
ORA-12541: TNS:no listener
Wed Jul 1 00:15:23 2009
Errors in file /ora/app/oracle/admin/kic/bdump/kic1_arc0_1042007.trc:
ORA-12541: TNS:no listener
Wed Jul 1 00:20:30 2009
Errors in file /ora/app/oracle/admin/kic/bdump/kic1_arc0_1042007.trc:
ORA-12541: TNS:no listener
Wed Jul 1 00:25:37 2009
Errors in file /ora/app/oracle/admin/kic/bdump/kic1_arc0_1042007.trc:
ORA-12541: TNS:no listener
Wed Jul 1 00:30:44 2009
Errors in file /ora/app/oracle/admin/kic/bdump/kic1_arc0_1042007.trc:
ORA-12541: TNS:no listener
Wed Jul 1 00:35:51 2009
Errors in file /ora/app/oracle/admin/kic/bdump/kic1_arc0_1042007.trc:
ORA-12541: TNS:no listener
============================================
Thanks
Khalid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2010 11:56 PM
тАО01-20-2010 11:56 PM
Solutionawk '
# assume timestamp is first
BEGIN {
getline
logname = $5 "_" $2 ".log"
print $0 > logname
}
# assume this matches timestamp
NF == 5 && length($1) == 3 && length($2) == 3 && length($4) == 8 && length($5) == 4 {
logname2 = $5 "_" $2 ".log"
if (logname2 != logname) {
close(logname)
logname = logname2
}
print $0 > logname
next
}
{
print $0 > logname
}' input-log
This will create files with YYYY_MMM.log.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2010 12:04 AM
тАО01-21-2010 12:04 AM
Re: Redirect Logs into Other file
Its working for me.
Regards
Khalid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2010 12:31 AM
тАО01-21-2010 12:31 AM
Re: Redirect Logs into Other file
You can check also a more complex solution:
http://logdistiller.sourceforge.net/
It has log parsing facilities.
Best regards,
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2010 10:47 PM
тАО01-24-2010 10:47 PM
Re: Redirect Logs into Other file
Thanks a lot.
Khalid Shakoor