Sponsored Content
Top Forums Shell Programming and Scripting Return db2 query value to shell script Post 302868289 by pradeep84in on Sunday 27th of October 2013 03:43:55 AM
Old 10-27-2013
Hi Sup,

You can redirect the entire dblog event to the log file as below and then you can do the filtering on the same.

Code:
db2  <<EOSQL>/home/testuser/count.lst

Thanks & Regards,
Pradeep Agarwal
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

return DB2 SQLCODE

Hello All, I have 2 shell scripts. script1.sh script2.sh script1.sh call script2.sh script2 will connect to DB2 database and execute a insert statement. I am capturing the return value of insert statement in an variable called SQLCODE. I want to return this SQLCODE to the calling script... (0 Replies)
Discussion started by: kjaisan
0 Replies

2. Shell Programming and Scripting

Query Oracle tables and return values to shell script that calls the query

Hi, I have a requirement as below which needs to be done viz UNIX shell script (1) I have to connect to an Oracle database (2) Exexute "SELECT field_status from table 1" query on one of the tables. (3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies

3. Shell Programming and Scripting

Db2 query with script

Hi All, I want to connect two tables in DB2 using shell script and then compare the contents of two tables field by field.and i should return on the screen the un matched records .. Could any one please help me in connecting database tables using Unix and retriving data from the same. (1 Reply)
Discussion started by: kanakaraju
1 Replies

4. Shell Programming and Scripting

access db2 from shell script

How to connect to db2 through shell script using cygwin? (0 Replies)
Discussion started by: supriyat
0 Replies

5. Shell Programming and Scripting

How to put db2 query result into an array in shell script?

Hello, Can someone please advise me how to put the db2 query reult into an array? For example, the query reults are: string A string B string C Then how do I put them into array=string A array=string B ... (2 Replies)
Discussion started by: hanul
2 Replies

6. Shell Programming and Scripting

connect to db2 using shell script

Guys, I am trying to write a shell script that connect to wcsprod database and read the query #!/bin/ksh sqlplus -s < connect to wcsprod user wcsadm using pwd > select * from catentry fetch first 1 row only with ur; databse: wcsprod user: wcsadm pwd: pwd thanks (1 Reply)
Discussion started by: skatpally
1 Replies

7. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

8. Shell Programming and Scripting

Query the table and return values to shell script and search result values from another files.

Hi, I need a shell script, which would search the result values from another files. 1)execute " select column1 from table_name" query on the table. 2)Based on the result, need to be grep from .wft files. could please explain about this.Below is the way i am using. #!/bin/sh... (4 Replies)
Discussion started by: Rami Reddy
4 Replies

9. Shell Programming and Scripting

Problem in shell script db2 query for fetching and comparing records

hi.. my requirement is following: i want to have a shell script that queries a table i.e. fcm_auth in database fcmcore (I use db2) to get no of rows present for a given combination eg org and logo for past 5-10 mins interval. You can take some values of org(numerical values) and corresponding... (2 Replies)
Discussion started by: nishantrefound
2 Replies

10. Shell Programming and Scripting

Db2 query on other host

Hello, i need some help with a script. I made a script, which connect to different hosts to get some informations. But i got now some problems with getting informations of a database (db2) which is on a other host. I tried something like var=$(rsh HOST su - db2adm -c "db2 connect to database;... (2 Replies)
Discussion started by: Cyver
2 Replies
EVENTLOGADM(8)						    System Administration tools 					    EVENTLOGADM(8)

NAME
eventlogadm - push records into the Samba event log store SYNOPSIS
eventlogadm [-d] [-h] -o addsource EVENTLOG SOURCENAME MSGFILE eventlogadm [-d] [-h] -o write EVENTLOG eventlogadm [-d] [-h] -o dump EVENTLOG RECORD_NUMBER DESCRIPTION
This tool is part of the samba(1) suite. eventlogadm is a filter that accepts formatted event log records on standard input and writes them to the Samba event log store. Windows client can then manipulate these record using the usual administration tools. OPTIONS
-d The -d option causes eventlogadm to emit debugging information. -o addsource EVENTLOG SOURCENAME MSGFILE The -o addsource option creates a new event log source. -o write EVENTLOG The -o write reads event log records from standard input and writes them to the Samba event log store named by EVENTLOG. -o dump EVENTLOG RECORD_NUMBER The -o dump reads event log records from a EVENTLOG tdb and dumps them to standard output on screen. -h Print usage information. EVENTLOG RECORD FORMAT
For the write operation, eventlogadm expects to be able to read structured records from standard input. These records are a sequence of lines, with the record key and data separated by a colon character. Records are separated by at least one or more blank line. The event log record field are: o LEN - This field should be 0, since eventlogadm will calculate this value. o RS1 - This must be the value 1699505740. o RCN - This field should be 0. o TMG - The time the eventlog record was generated; format is the number of seconds since 00:00:00 January 1, 1970, UTC. o TMW - The time the eventlog record was written; format is the number of seconds since 00:00:00 January 1, 1970, UTC. o EID - The eventlog ID. o ETP - The event type -- one of "INFO", "ERROR", "WARNING", "AUDIT SUCCESS" or "AUDIT FAILURE". o ECT - The event category; this depends on the message file. It is primarily used as a means of filtering in the eventlog viewer. o RS2 - This field should be 0. o CRN - This field should be 0. o USL - This field should be 0. o SRC - This field contains the source name associated with the event log. If a message file is used with an event log, there will be a registry entry for associating this source name with a message file DLL. o SRN - The name of the machine on which the eventlog was generated. This is typically the host name. o STR - The text associated with the eventlog. There may be more than one string in a record. o DAT - This field should be left unset. EXAMPLES
An example of the record format accepted by eventlogadm: LEN: 0 RS1: 1699505740 RCN: 0 TMG: 1128631322 TMW: 1128631322 EID: 1000 ETP: INFO ECT: 0 RS2: 0 CRN: 0 USL: 0 SRC: cron SRN: dmlinux STR: (root) CMD ( rm -f /var/spool/cron/lastrun/cron.hourly) DAT: Set up an eventlog source, specifying a message file DLL: eventlogadm -o addsource Application MyApplication | \ %SystemRoot%/system32/MyApplication.dll Filter messages from the system log into an event log: tail -f /var/log/messages | \ my_program_to_parse_into_eventlog_records | \ eventlogadm SystemLogEvents VERSION
This man page is correct for version 3.0.25 of the Samba suite. AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed. Samba 3.5 06/18/2010 EVENTLOGADM(8)
All times are GMT -4. The time now is 01:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy