Sponsored Content
Top Forums Shell Programming and Scripting Parse Logfile output variable Post 302266251 by Ikon on Tuesday 9th of December 2008 05:32:34 PM
Old 12-09-2008
Here is an actual snip from the log:
Code:
<SUMMARY filecount_excluded="0" dirbytes_sent="3367893" dirbytes_hashcache="13275664"><session numthreads="1" 
type="avtarbackup" ndispatchers="1"><host numprocs="4" speed="900" osuser="root" name="ashsux01" memory="24545" />
<build time="11:04:53" msgversion="13-10" appname="avtar"/><dirstats numfiles="193129" numbytes="1461473417216" 
numdirs="0" /></session><errorsummary exitcode="0" errors="0" warnings="0" fatals="0" /></SUMMARY>

The problem im running into is <SUMMARY has its own vars then within SUMMARY it has SESSION and within SESSION it has its vars and then DIRSTATS, BUILD.

like this:
Code:
<SUMMARY VARS...>
	<SESSION VARS...>
		<BUILD VARS.../>
		<DIRSTATS VARS.../>
	</SESSION>
	<ERRORSUMMARY VARS...\>
</SUMMARY>

The actual log file has many others within summary and some not called summary they might be called something completely different than SUMMARY or SESSION.

Last edited by Ikon; 12-11-2008 at 05:52 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parse variable

I have a variable (it is a date actually -> 2007-01-03) which would be passed in as parameter, what I want is to parse in and put year, month, and day in separate variables, I have tried the following but doesn't work echo $dt | awk -F- '{print $1 $2 $3}' | read y m d Thanks in... (2 Replies)
Discussion started by: mpang_
2 Replies

2. Shell Programming and Scripting

how to parse value of the variable

I have a variable which has a full path to the file, for example : A=/t1/bin/f410pdb Does anybody know the command to parce this variable and assign the result to 3 other variables so each subdirectory name will be in a new variable like this B=t1 C=bin D=f410pdb Many thanks -A (5 Replies)
Discussion started by: aoussenko
5 Replies

3. Shell Programming and Scripting

how to create a logfile to track the below script output

Hi Dudes, Can you please suggest me how to create a logfile to track the below script output ? Thanks #!/bin/ksh # backup the "std" I/P file descriptor exec 5<&0 #echo "Proceed ?" while read config_line; do # backup the I/P file descriptor of "while" block exec 6<&0 # restore the... (2 Replies)
Discussion started by: shirdi
2 Replies

4. Shell Programming and Scripting

Parse output path to set variable

I am looking to parse a text file output and set variables based on what is cropped from the parsing. Below is my script I am looking to add this feature too. All it does is scan a certain area of users directories for anyone using up more than X amount of disk space. It then writes to the... (4 Replies)
Discussion started by: es760
4 Replies

5. Shell Programming and Scripting

Help about parse the variable

I'm using bash the code is QEMU_CMD="qemu-system-x86_64 -smp 2 -m 512 $QEMU_PARAMETER -hda $GUEST_IMAGE -kernel $GUEST_KERNEL -append \"root=/dev/hda rw console=ttyS0,115200 ip=$IP_PARAMETER \" -nographic" echo "..............................." echo "qemu command is... (9 Replies)
Discussion started by: yanglei_fage
9 Replies

6. Shell Programming and Scripting

Echo cannot redirect first or second output to logfile

I created a script to do some work. I want to use "echo" to redirect "date" to log file. echo works to screen. But cannot redirect first or second "echo" output to logfile. Please help. My code looks like: STARTTIME=`date +%m-%d-%Y` LOGFILE=/directory/logfile.log echo "Start time:" $STARTTIME... (8 Replies)
Discussion started by: duke0001
8 Replies

7. UNIX for Dummies Questions & Answers

Changes to write output to logfile and console

Friends, Below is the script which writes output to LOGFILE, however I want the entire log written to LOGFILE and also console. Please suggest me the changes I need to do here. #!/bin/ksh x=${0##*/} LOGFILE="x.log" echo "CAUTION : Files once deleted cannot be restored" printf 'Would... (8 Replies)
Discussion started by: fop4658
8 Replies

8. Shell Programming and Scripting

Logfile monitoring with logfile replacement

Bonjour, I've wrote a script to monitor a logfile in realtime. It is working almost perfeclty except for two things. The script use the following technique : tail -fn0 $logfile | \ while read line ; do ... some stuff done First one, I'd like a way to end the monitoring script if a... (3 Replies)
Discussion started by: Warluck
3 Replies

9. Shell Programming and Scripting

ksh and Oracle stored procedure output in logfile

Friends, I pass some runtime arguments (date, number) through ksh script to Oracle procedure, use input value and pass it on to procedure. Oracle procedure gets input value, run query and logs everything in the logfile. I'm facing with couple of challenges 1. Even though I pass all... (5 Replies)
Discussion started by: homer4all
5 Replies

10. UNIX for Beginners Questions & Answers

Grepping for one variable while using awk to parse an associated variable

Im trying to search for a single variable in the first field and from that output use awk to extract out the lines that contain a value less than a value stored in another variable. Both the variables are associated with each other. Any guidance is appreciated. File that contains the... (6 Replies)
Discussion started by: ncwxpanther
6 Replies
GIT-CHERRY(1)							    Git Manual							     GIT-CHERRY(1)

NAME
       git-cherry - Find commits yet to be applied to upstream

SYNOPSIS
       git cherry [-v] [<upstream> [<head> [<limit>]]]

DESCRIPTION
       Determine whether there are commits in <head>..<upstream> that are equivalent to those in the range <limit>..<head>.

       The equivalence test is based on the diff, after removing whitespace and line numbers. git-cherry therefore detects when commits have been
       "copied" by means of git-cherry-pick(1), git-am(1) or git-rebase(1).

       Outputs the SHA1 of every commit in <limit>..<head>, prefixed with - for commits that have an equivalent in <upstream>, and + for commits
       that do not.

OPTIONS
       -v
	   Show the commit subjects next to the SHA1s.

       <upstream>
	   Upstream branch to search for equivalent commits. Defaults to the upstream branch of HEAD.

       <head>
	   Working branch; defaults to HEAD.

       <limit>
	   Do not report commits up to (and including) limit.

EXAMPLES
   Patch workflows
       git-cherry is frequently used in patch-based workflows (see gitworkflows(7)) to determine if a series of patches has been applied by the
       upstream maintainer. In such a workflow you might create and send a topic branch like this:

	   $ git checkout -b topic origin/master
	   # work and create some commits
	   $ git format-patch origin/master
	   $ git send-email ... 00*

       Later, you can see whether your changes have been applied by saying (still on topic):

	   $ git fetch	# update your notion of origin/master
	   $ git cherry -v

   Concrete example
       In a situation where topic consisted of three commits, and the maintainer applied two of them, the situation might look like:

	   $ git log --graph --oneline --decorate --boundary origin/master...topic
	   * 7654321 (origin/master) upstream tip commit
	   [... snip some other commits ...]
	   * cccc111 cherry-pick of C
	   * aaaa111 cherry-pick of A
	   [... snip a lot more that has happened ...]
	   | * cccc000 (topic) commit C
	   | * bbbb000 commit B
	   | * aaaa000 commit A
	   |/
	   o 1234567 branch point

       In such cases, git-cherry shows a concise summary of what has yet to be applied:

	   $ git cherry origin/master topic
	   - cccc000... commit C
	   + bbbb000... commit B
	   - aaaa000... commit A

       Here, we see that the commits A and C (marked with -) can be dropped from your topic branch when you rebase it on top of origin/master,
       while the commit B (marked with +) still needs to be kept so that it will be sent to be applied to origin/master.

   Using a limit
       The optional <limit> is useful in cases where your topic is based on other work that is not in upstream. Expanding on the previous example,
       this might look like:

	   $ git log --graph --oneline --decorate --boundary origin/master...topic
	   * 7654321 (origin/master) upstream tip commit
	   [... snip some other commits ...]
	   * cccc111 cherry-pick of C
	   * aaaa111 cherry-pick of A
	   [... snip a lot more that has happened ...]
	   | * cccc000 (topic) commit C
	   | * bbbb000 commit B
	   | * aaaa000 commit A
	   | * 0000fff (base) unpublished stuff F
	   [... snip ...]
	   | * 0000aaa unpublished stuff A
	   |/
	   o 1234567 merge-base between upstream and topic

       By specifying base as the limit, you can avoid listing commits between base and topic:

	   $ git cherry origin/master topic base
	   - cccc000... commit C
	   + bbbb000... commit B
	   - aaaa000... commit A

SEE ALSO
       git-patch-id(1)

GIT
       Part of the git(1) suite

Git 2.17.1							    10/05/2018							     GIT-CHERRY(1)
All times are GMT -4. The time now is 01:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy