Fetch data from file

Hi,

I am new to scripting. I have a log file and need to fetch specific logs and copy to another file.
A copy of the log is like this:

===============================================================
= JOB       : server123#jobs1[(0600 08/01/17),(0AAAAAAAAAACA3LL)].jobstream1
= USER      : andyc            
= Tue 08/01/17 06:01:02 CDT
===============================================================
TWS for UNIX/JOBMANRC 8.5.1

Tivoli Workload Scheduler (UNIX)/JOBINFO 8.5.1 (20091127)
Installed for user "andyc".
Locale LANG set to the following: "en"
Removes files and directories older than -32.
AWSBIS308I End of job
===============================================================
= Exit Status           : 0
= System Time (Seconds) : 0     Elapsed Time (Minutes) : 0
= User Time (Seconds)   : 0
= Tue 08/01/17 06:01:02 CDT
===============================================================

Now, I need output from first, second, third and last four lines. The lines in the log file are not fixed. And the format I need is like:

Server name: server123 | job: jobs1 | jobstream: jobstream1 | Start Time: Tue 08/01/17 06:01:02 CDT | Exit Status: 0 | Time consumed: 0

Welcome to the forum.

Any attempts / ideas / thoughts from your side?

Please be aware that the start time cannot be identified unambiguously from your data - so which time stamp to extract? And, is the assumption correct that "Time consumed" is "System time"?

Hi RudiC,
My bad, didn't clarified earlier:
Start Time to be captured from Line 4
Time Consumed: Elasped time

I tried awk command but didn't got desired output after several attempts.

Please show us the awk code that you tried so we can help you find out where you got stuck.

With Tivoli and UNIX in your sample data, we might guess that you're using AIX and ksh , but when posting questions about using common utilities on BSD, Linux, and UNIX systems it is always a good idea to tell us explicitly what operating system and shell you're using.