Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I'm writing a bash script which is designed to monitor WebSphere Queues. I've got it working in principle. However dependent on the length of text the queue name is, ...
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    4

    [SOLVED] Data output format issue awk or cut?

    Hi,

    I'm writing a bash script which is designed to monitor WebSphere Queues.

    I've got it working in principle. However dependent on the length of text the queue name is, I get varied output which has become an issue because the "cut" and "awk" rule varies for different queue outputs.

    EG on the two lines of output I'm getting:

    que_dep= TYPE(QUEUE) CURDEPTH(0)
    que_dep= CURDEPTH(0) IPPROCS(0)

    Can anyone suggest how I can possibly "cut" or "awk" the "CURDEPTH(0)" value ONLY from these lines?

    Thanks

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,097
    egrep might help
    Code:
    egrep -o "CURDEPTH\([0-9]{1,1}\)" logfile
    Adjust the regex to the possible values of curdepth
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Aug 2010
    Posts
    4
    Thanks! That works well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...