Sponsored Content
Top Forums Shell Programming and Scripting Grep out ONLY subject from maillog Post 302874355 by anil510 on Friday 15th of November 2013 12:16:01 AM
Old 11-15-2013
Grep out ONLY subject from maillog

I have the following entries in maillog. I need to grep out only the subject part from the following entries. Maillog contain following entries.

Code:
2013-11-14 03:30:02 [441847] 1Vgnd4-001qwZ-36 <= user@domain.com U=user P=local S=9797  id=cd3732bbd0fbda5cb16384bb7d5b465d@localhost.localdomain T="Subject Subject  Subject" from <user@domain.com> for  anothermail@newdomain.com

After applying the sed/awk, we should get result as follows.
Code:
Subject Subject  Subject

To summarize, the pattern, after T= should be printed.

Eg:
T="sub sub sub"
Should print
sub sub sub
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

maillog - Error Message

dear expert Im using shell script to send mail from unix server. My script like below: #! /bin/sh -f # Set necessary variables #export PATH #PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/contrib/bin PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/contrib/bin:$PATH; export PATH... (0 Replies)
Discussion started by: unknown2205
0 Replies

2. UNIX for Advanced & Expert Users

maillog extract

Hi all, below are some text extracted from maillog. I have a cronjob running at 1720 daily and it will send mails to me. it was working fine on the 27 Sept.Sep 27 17:20:01 venus sendmail: k8R9K0OR032710: from=user1, size=580, class=0, nrcpts=1, msgid=<200609270920.k8R9K0OR032710@venus.domain.com>,... (1 Reply)
Discussion started by: new2ss
1 Replies

3. UNIX for Advanced & Expert Users

maillog errrors

Watching my maillog this morning i have discovered some errors but I cant track down whats causing them. Jun 16 11:04:12 ws096 sendmail: m5GExW7e006613: Milter (spamass-milter): timeout before data read Jun 16 11:04:12 ws096 sendmail: m5GExW7e006613: Milter (spamass-milter): to error state Jun... (3 Replies)
Discussion started by: mcraul
3 Replies

4. Gentoo

inserting grep -c value into an email subject

I am profoundly new to *nix, but had a project dropped in my lap that has sparked an interest, leading me here. I was tasked with daily sending one of our customers a listing of all the spam our filter blocked that was heading for them. Between Google and I; I discovered the Server is running... (3 Replies)
Discussion started by: GrendelPrime
3 Replies

5. UNIX for Advanced & Expert Users

/var/log/maillog isn't updating. Postfix related

can someone please help me figure how i can get maillog to start updating again? it just all of a sudden stopped. and postfix isn't writing to it anymore. I'm running a Ubuntu box 8.04 thanks (2 Replies)
Discussion started by: SkySmart
2 Replies

6. Solaris

Flood Messages in maillog

Hi All, I am getting large number of messages in below file /www/wls8/logs/HOSTS/tswebd01-zd01/maillog/maillog In past 24 hours, it has been increased by near to 1 GB. Can somebody help in finding, from where these messages are being generated and how to I stop them ? Same kind of messages... (11 Replies)
Discussion started by: solaris_1977
11 Replies

7. Shell Programming and Scripting

Grep the last line and put on mail subject

I have mail: cat /home/oracle/scripts/dbsizedaily.txt | mail -s "$TODAY: PROD DB Size" $RECIPIENTS I like to get and put USED_GB and %USED of the very last row from /home/oracle/scripts/dbsizedaily.txt. /home/oracle/scripts/dbsizedaily.txt has : DATE TIME TOTAL_GB USED_GB ... (6 Replies)
Discussion started by: Daniel Gate
6 Replies

8. UNIX for Dummies Questions & Answers

How to grep a string and add to subject line of a mail?

I am running a mailx command as follows in Linux: mailx -s "Elapsed Time: " ora_dbas < $RUNDIR/sql_timings.out I am trying to parse the file "sla_local_sql_timings.out" for the word Elapsed Time: and get the time from that file stored in a variable and display that variable in the subject... (4 Replies)
Discussion started by: vrkcamry
4 Replies

9. Shell Programming and Scripting

Filter maillog

Hi, I need to take them all fields SendTo and ip address from a file maillog First I look at all emails from containing the empty field. # zcat /var/log/mail/maillog-20140331.server1.gz | grep "from=<>" | awk '{print $6}' > 1.txt output: Mar 30 23:31:24 servidor1 postfix/smtpd:... (2 Replies)
Discussion started by: Jomeaide
2 Replies

10. Shell Programming and Scripting

Inconsistent `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l`

i have this line of code that looks for the same file if it is currently running and returns the count. `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l` basically it is assigned to a variable ISRUNNING=`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh |... (6 Replies)
Discussion started by: wtolentino
6 Replies
list_config_entries(3alleg4)					  Allegro manual				      list_config_entries(3alleg4)

NAME
list_config_entries - Lists the names of all entries in a config section Allegro game programming library. SYNOPSIS
#include <allegro.h> int list_config_entries(const char *section, const char ***names); DESCRIPTION
This function can be used to get a list of all entries in the given config section. The names parameter is a pointer to an array of strings. If it points to a NULL pointer, the list will be allocated, else it will be re-allocated. You should free the list again with free_config_entries if you don't need it anymore, or you can pass it again to list_config_entries and the memory will be re-used. See the following example for how you can use it, it will print out the complete contents of the current configuration: int i, n; char const **sections = NULL; char const **entries = NULL; /* List all entries not in any section. */ n = list_config_entries(NULL, &entries); for (i = 0; i printf(" %s="%s" ", entries[i], get_config_string( NULL, entries[i], "-")); /* List all sections (and entries in them). */ n = list_config_sections(&sections); /* loop through all section names */ for (i = 0; i { int j, m; printf("%s ", sections[i]); m = list_config_entries(sections[i], &entries); /* loop through all entries in the section */ for (j = 0; j { printf(" %s="%s" ", entries[j], get_config_string( sections[i], entries[j], "-")); } } /* It is enough to free the arrays once at the end. */ free_config_entries(&sections); free_config_entries(&entries); RETURN VALUE
Returns the number of valid strings in the names array. SEE ALSO
set_config_file(3alleg4), get_config_string(3alleg4), list_config_sections(3alleg4), free_config_entries(3alleg4) Allegro version 4.4.2 list_config_entries(3alleg4)
All times are GMT -4. The time now is 12:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy