Need to develop a bash script to create customized report from the server log


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to develop a bash script to create customized report from the server log
# 1  
Old 04-07-2015
Need to develop a bash script to create customized report from the server log

Hi,
I need to develop a bash script to create customized report from the server log (red hat 5.8 64 bit Operating system). The following is one of the log for our internal application task.

Code:
<2015.03.03 20:09:52 274 +0800><I><DSCTH01><http-0.0.0.0-443-2><security> GUI request succeeded for AZIZ@61.6.223.236
  addManagedObject[
    SprAccount{
      id = 69425889,
      accountId = 520074_2429971,
      state = NONE,
      billingDay = 1,
      resetHour = 0,
      lastSyncTime = 0,
      unknownAccount = false,
      subscribers = {
        SprSubscriber{
          id = 69425897,
          userId = 2429971,
          category = Residential,
          subscriptionIds = {
            SubscriptionId{
              type = END_USER_NAI,
              data = GDG_FRAME_02 xpon 0/7/0/5:17.1.10}},
          notificationConfig = NotificationConfig{
            notifyableByEmail = true,
            notifyableBySMS = false},
          overagePermissable = true,
          state = ENABLED,
          account = SprAccount#69425889,
          syOCSEnabled = false}},
      customDataProfiles = {
        home5},
      customData = {
        Throttled = SprGenericValue{
          type = STRING,
          value = N},
        Sub_Status = SprGenericValue{
          type = STRING,
          value = Active},
        First Name = SprGenericValue{
          type = STRING,
          value = MOHD AL JOHANI BATUA-AN AMINGOS},
        Physical Port = SprGenericValue{
          type = STRING,
          value = GDGF05A-R3-8SP02-1}},
      meteredServices = {
        MeteredService{
          id = 69425891,
          meteringLimitName = UPLOAD,
          defaultShare = QuotaShareRange{
            min = 0,
            max = -1},
          account = SprAccount#69425889,
          serviceType = METERING_LIMIT},
        MeteredService{
          id = 69425893,
          meteringLimitName = DOWNLOAD,
          defaultShare = QuotaShareRange{
            min = 0,
            max = -1},
          account = SprAccount#69425889,
          serviceType = METERING_LIMIT},
        MeteredService{
          id = 69425895,
          meteringLimitName = home5-ml,
          defaultShare = QuotaShareRange{
            min = 0,
            max = -1},
          account = SprAccount#69425889,
          serviceType = METERING_LIMIT}}}]

In the I need to capture and create a table as following format:
Code:
Date | Time | Status | User@IP | account ID | service no | CUG | Account Name | BW

Date, Time, Status, User@IP found in the first line of the log.
Account ID, service nos = > accountId = 520074_2429971.
CUG = > category = Residential,
Account Name = > value = MOHD AL JOHANI BATUA-AN AMINGOS},
BW = > meteringLimitName = home5-ml,

Please suggest to develop a script.

Thanks

Last edited by pugazhendhi_r; 04-07-2015 at 05:47 AM.. Reason: bash script
# 2  
Old 04-07-2015
Hi, welcome to the forums.

1. Use Code tags for code blocks
2. Use icode tags for single words.
3. What is your expected output? How shall that rerport look like?
4. What have you tried so far to achieve this yourself?

Have a nice day.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies

2. Red Hat

Customized boot log messages

Hi all Many years ago, I found online this script that was incredibly funny and I had blogged it Unfortunately because of my poor record-keeping, I seem to have lost the shell script Would somebody be kind enough to tell me how to replicate this? Thank you! (0 Replies)
Discussion started by: hedkandi
0 Replies

3. Red Hat

Unable to create customized multipath device

Hi, I am testing on iSCSI + multipath, where i have one iSCSI lun assigned to one server. mpatha (1IET 00010001) dm-2 IET,VIRTUAL-DISK size=100M features='0' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1 status=active | `- 2:0:0:1 sda 8:0 active ready running `-+-... (6 Replies)
Discussion started by: linux.amrit
6 Replies

4. AIX

How to put customized error report on errpt ?

Hi Gurus, Here is a requirement from my side, i have a script root password expiary, means this script will examine if root password has been expired or not, if it's expired then it will write into a file and mail to certain mail id till here everything is fine. But i want it to write to errpt,... (3 Replies)
Discussion started by: linux.amrit
3 Replies

5. Programming

CGI Perl script to execute bash script- unable to create folder

Hi I have a bash script which takes parameters sh /tmp/gdg.sh -b BASE-NAME -n 1 -s /source/data -p /dest/data/archive -m ARC gdg.sh will scan the /source/data and will move the contents to /dest/data/archive after passing through some filters. Its working superb from bash I have... (0 Replies)
Discussion started by: rakeshkumar
0 Replies

6. Shell Programming and Scripting

"Customized" log rotate script - some advice please

Hi, Am trying to write my own version of a log rotate scripts 'coz I don't have the logrotate for other flavors of *nix servers. Probably should try and download the source and re-compile but our SA don't want to do so. Anyway, just want to know if there is any way to improve on the code... (0 Replies)
Discussion started by: newbie_01
0 Replies

7. Ubuntu

Create a customized ubunto automated installtion cd

Hi 1- I want to create a cd or dvd of ubunto , that include a lot of installed packages entered by me . 2- automated installion (just enter the cd )and install by it self . (3 Replies)
Discussion started by: rashed
3 Replies

8. Shell Programming and Scripting

Need to develop a script to create a report reading multiple server logs

I am currently trying to develop a script to connect to mulltiple servers, reading specifc data from log files on the servers and append the data from each file into a single tab delimited row. So, at the end I am planning to have a report with all the extracted data with each row per server. I am... (5 Replies)
Discussion started by: scriptingnewbie
5 Replies

9. Shell Programming and Scripting

Bash: create a report with grep output?

Greetings. I need to generate a simple report via Bash (Korn?) with this raw data Test_Version=V2.5.2 Test_Version=V2.6.3 Test_Version=V2.4.7 Test_Version=V2.5.2 Test_Version=V2.5.2 Test_Version=V2.5.1 Test_Version=V2.5.0 Test_Version=V2.3.9 ... (3 Replies)
Discussion started by: alan
3 Replies

10. Homework & Coursework Questions

shell script that can create, monitor the log files and report the issues for matching pattern

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write an automated shell program(s) that can create, monitor the log files and report the issues for matching... (0 Replies)
Discussion started by: itian2010
0 Replies
Login or Register to Ask a Question