Build Stats out of output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Build Stats out of output
# 8  
Old 02-24-2011
Quote:
Originally Posted by john_prince
Here is the content that i want pull up :

Code:
nsslapd-accesslog-logging-enabled: on
nsslapd-accesslog: /export/apps/EIS/dir/slapd-ED/logs/access
nsslapd-accesslog-maxlogsperdir: 10
nsslapd-accesslog-maxlogsize: 100
nsslapd-accesslog-logrotationtime: 1
nsslapd-accesslog-logrotationtimeunit: day

  1. I've asked for the records/lines from the ORIGINAL file - not what the report should look like.
  2. If this is the desired report, it's not what you were after originaly
Still need a set of records from the ORIGINAL file.
# 9  
Old 02-24-2011
That is record from original file, and not the output.
# 10  
Old 02-24-2011
Quote:
Originally Posted by john_prince
That is record from original file, and not the output.
Oh, I see - your original had the 'grep' incorporated into it so it added a field.
Here it's:
Code:
nawk -F: 'BEGIN{fmt="%-50s%-40s%-10s\n";printf(fmt,"Path","Attribute","Value")}tolower($1)~"nsslapd-accesslog*" {printf(fmt,FILENAME,$1,$2)}'  /apps/EIS/dir/slapd-ED/config/dse.ldif

Sorry for the confusion....
# 11  
Old 02-28-2011
Thank you very much - it works. I have two following questions:

1. If you see below output, first and second column are overlapping, which parameter i should increase to accommodate longer values. can't this be dynamic? ( I know i am asking too much, but just in case you know something )

Code:
/apps/EIS/dir/slapd-dev_Operational/config/dse.ldifnsslapd-accesslog                        /export/apps/EIS/dir/slapd-dev_Operational/logs/access
/apps/EIS/dir/slapd-dev_Operational/config/dse.ldifnsslapd-accesslog-maxlogsperdir          10       
/apps/EIS/dir/slapd-dev_Operational/config/dse.ldifnsslapd-accesslog-logrotationtime        1        
/apps/EIS/dir/slapd-dev_Operational/config/dse.ldifnsslapd-accesslog-logrotationtimeunit    day      
/apps/EIS/dir/slapd-dev_Operational/config/dse.ldifnsslapd-accesslog-logging-enabled        on

2. Also, what are places i should change to add new fields.

- John
# 12  
Old 02-28-2011
Code:
nawk -F: 'BEGIN{fmt="%-50s%-40s%-10s%-20s\n";printf(fmt,"Path","Attribute","Value","myNewField")}tolower($1)~"nsslapd-accesslog*" {printf(fmt,FILENAME,$1,$2,$3)}'  /apps/EIS/dir/slapd-ED/config/dse.ldif

This User Gave Thanks to vgersh99 For This Post:
# 13  
Old 02-28-2011
Thank You !
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

(VS 2008) New build config looking files from other folder build config

Hi Team, My new build configuration always looking for the files from the build where i copied from. please help me to resolve this. I am using Visual studio 2008.It has Qt 4.8. plugins,qml,C++ development I created new debug_new build configuration with additional preprocessor from the... (1 Reply)
Discussion started by: SA_Palani
1 Replies

2. Shell Programming and Scripting

Build.xml invocation by Build Script

Hi I have a build.xml file and I can run it on Windows via cmd. Now I want to write a script to invoke the same. Is there a way to do this? (1 Reply)
Discussion started by: ankur328
1 Replies

3. UNIX for Dummies Questions & Answers

Adding SDK Build on Kernel Source Build

Hi, So I downloaded this kernel source and was able to build it successfully. But I want to add this SDK source code inside, can anyone help me how to do this? Note that the SDK source can be built by itself. I added the SDK in the main Makefile: init-y := init/ #added SDK... (0 Replies)
Discussion started by: h0ujun
0 Replies

4. Linux

Stats on subdirectories

Please help me with a shell script to get the stats on many subdirectories (sub1), (sub2) etc under a mother directory (big) /big | |_______sub1 |_______sub2 |_______sub3 --------- I want to know 1. What is the last file accessed in each subdirectory with date and by whom 2.... (2 Replies)
Discussion started by: digipak
2 Replies

5. Shell Programming and Scripting

Using Stats in Php

So, I have a php program that i need to delete ALL files in a directory that are older than a certain age. <?php /* Get file stat */ $stat = stat('/apps/security/ajaba'); This is as far as I've been able to get. I know in shell programming you can easily do something like this. but I'm... (2 Replies)
Discussion started by: SkySmart
2 Replies

6. UNIX for Advanced & Expert Users

vmstat's cpu stats on first line of output are always the same

Hello, I'm seeing this problem with vmstat, where the first line of output always has the same CPU statistics. For example: neked@nekedmachine:~$ date && vmstat Fri Jul 24 06:57:08 EDT 2009 procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ r b swpd ... (0 Replies)
Discussion started by: neked
0 Replies

7. AIX

IO Stats

Aix 5.3 I am trying to view the IO stats. I do the sar 5 5 but that is the WIO and si different than the IO stats right? I am just blanking on this. I know there is a command that I used to run that brings up a whole bunch of live stats that run live such as mem and so on just can't rememeber... (4 Replies)
Discussion started by: rocker40
4 Replies

8. AIX

system stats

I recieved this out put below soemhow. Unfortunatly I did not write down the command I used to get it. Can someone tell me what command I use to gather these stats? OS = AIX 5.3 64Bit System Model: IBM,7026-6H1 Machine Serial Number:... (2 Replies)
Discussion started by: rocker40
2 Replies

9. UNIX for Advanced & Expert Users

I/O Stats Metrics

What do others use for measuring I/O statistics? I'd like something versatile, as in being able to watch (like iostat, but easier to trend), generate load (like iozone, but more realistic), and perform somewhat generalized benchmarks (like bonnie, but more current.) It would scale from a few... (0 Replies)
Discussion started by: LivinFree
0 Replies
Login or Register to Ask a Question