Sponsored Content
Operating Systems Linux Red Hat Need help with a shell script for finding a certain pattern from log file Post 302494702 by rockf1bull on Tuesday 8th of February 2011 06:35:43 AM
Old 02-08-2011
One more thing I wanted was to remove any duplicate lines in a bunch of hundreds of lines.

For e.g - If I have following,

portal-test-domain-com
portal-test-domain-com
portal-test-domain-com

I just need them to be only one line saying portal-test-domain-com instead of 3.

Also I need to remove certain parts of each line.

For e.g -
abbbs://porta-test-domain.com/wps/urportal/weber/localbr&ticket=ST-385945-1cdbuEe1o57neMuMgIWa-1681078B-DFC2-7B56-E58B-AA15B18411AD&pgtUrl=https

I need to remove first abbbs and remove everything after domain.com.


If someone can help me, that would be really great since I am still learning these things and it will be at least good couple of weeks before I would do them on my own.

Thanks in advance,
Andy.

---------- Post updated at 05:05 PM ---------- Previous update was at 04:30 PM ----------

Ok, I have just managed to remove the first http:// part from ALL lines of the log file and have also remove the https part of ALL lines to have a much better output for now.

The only part remaining for now is to find and remove all duplicate URLs as mentioned above. Will post a fix here if I find any; till then all suggestions are welcome.

Thanks,
Andy
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help with finding & replacing pattern in a file

Hi everyone. Could u be so kind and help me with on "simple" shell script? 1. i need to search a file line by line for a pattern. example of a lines in that file 2947 domain = feD,id = 00 0A 02 48 17 1E 1D 39 DE 00 0E 00,Name Values:snNo = f10 Add AttFlag = 0 2. i need to find... (0 Replies)
Discussion started by: dusoo
0 Replies

2. Shell Programming and Scripting

script for finding an error from a log file

Hi , I have a doubt about a shell script to find an ERROR from the log file. But I need to specify a the scan from a particular date and time in the log. Till now I have developed the following script. Please suggest what shall I add in this for date and time. If the script finds a particular... (5 Replies)
Discussion started by: himvat
5 Replies

3. Shell Programming and Scripting

Script to monitor the pattern in the log file

hi All, how to find a pattern in the log file & display the above and below line for example in the log file, i have many lines, whenever i search for "Category" it should display the above line with only few parameter like i want only the location name & department name Thu Jul 02 11:05:23... (2 Replies)
Discussion started by: rithick256
2 Replies

4. 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

5. Shell Programming and Scripting

Finding log files that match number pattern

I have logs files which are generated each day depending on how many processes are running. Some days it could spin up 30 processes. Other days it could spin up 50. The log files all have the same pattern with the number being the different factor. e.g. LOG_FILE_1.log LOG_FILE_2.log etc etc ... (2 Replies)
Discussion started by: atelford
2 Replies

6. Shell Programming and Scripting

Finding the pattern and replacing the pattern inside the file

i have little challenge, help me out.i have a file where i have a value declared and and i have to replace the value when called. for example i have the value for abc and ccc. now i have to substitute the value of value abc and ccc in the place of them. Input File: go to &abc=ddd; if... (16 Replies)
Discussion started by: saaisiva
16 Replies

7. Shell Programming and Scripting

Finding file pattern in ksh 88

Hi, I've to find the file which has the pattern "Delete Report for History Tables" and need to search this file pattern from directory which has sub directories as well. I'm using ksh 88 Please suggest me which command will be used to find the file pattern . Thanks. (1 Reply)
Discussion started by: smile689
1 Replies

8. Shell Programming and Scripting

Script to search for a pattern in 30 minutes from a log file

Hello All, I have to write a script which will search for diffrent patterns like "Struck" "Out of Memory" , etc from a log file in Linux box's. Now I will be executing a cron job to find out the results by executing the script once in every 30 minutes. suppose time is 14-04-29:05:31:09 So I... (3 Replies)
Discussion started by: Shubhasis Mathr
3 Replies

9. Shell Programming and Scripting

Finding file extension on C Shell script

I very new to C Shell. I am trying to do is read from Command line. Find the if the file is zip, .txt, symbloic link,pipe, unknow (if file is not zip, txt, sy....) here is what I what got so far. I am very stuck atm Please help me out : If the file is symblooc link what file is link to ... (12 Replies)
Discussion started by: madbull41
12 Replies

10. Shell Programming and Scripting

Finding the file name in a directory with a pattern

I need to find the latest file -filename_YYYYMMDD in the directory DIR. the below is not working as the position is shifting each time because of the spaces between(occuring mostly at file size field as it differs every time.) please suggest if there is other way. report =‘ls -ltr... (2 Replies)
Discussion started by: archana25
2 Replies
rmvol(8)						      System Manager's Manual							  rmvol(8)

NAME
rmvol - Removes a volume from an existing file domain SYNOPSIS
/usr/sbin/rmvol [-f] [-v] special domain OPTIONS
Forces the removal of a volume that contains one or more stripe segments without first requesting confirmation. Displays messages that describe which files are moved off the specified volume. Using this option slows the rmvol process. OPERANDS
Specifies the block device special file name, such as /dev/disk/dsk2c, of the volume that you are removing from the file domain. Specifies the name of the file domain. DESCRIPTION
The rmvol utility enables you to decrease the number of volumes within an existing file domain. When you attempt to remove a volume, the file system automatically migrates the contents of that volume to another volume in the file domain. The logical structure of the filesets in a file domain is unaffected when you remove a volume. If you remove a volume that contains a stripe segment, the rmvol utility moves the segment to another volume that does not already contain a stripe segment of the same file. If a file is striped across all volumes in the file domain, the utility requests confirmation before placing a second stripe segment on a volume that has one. Before you can remove a volume from a file domain, all filesets in the file domain must be mounted. If you try to remove a volume from an active file domain that includes unmounted filesets, the system displays an error message indicating that a fileset is unmounted. This mes- sage is repeated until you mount all filesets in the file domain. If you attempt to remove a volume from an inactive file domain, the system returns the ENO_SUCH_DOMAIN error message. A file domain is inactive when none of its filesets is mounted. In this case, the rmvol command does not remove the volume. If there is not enough free space on other volumes in the file domain to accept the offloaded files from the departing volume, the rmvol utility moves as many files as possible to free space on other volumes. Then a message is sent to the console indicating that there is not enough space to complete the procedure. The files that were not yet moved remain on the original volume. You can interrupt the rmvol process without damaging your file domain. AdvFS will stop removing files from the volume. Files already removed from the volume will remain in their new location. Interrupting an rmvol operation with the kill command can leave the volume in an inaccessible state. If a volume does not allow new allocations after an rmvol operation, use the chvol command with the -A option to reac- tivate the volume. RESTRICTIONS
You cannot run the rmvol utility while the defragment, balance, rmfset, or rmvol utility is running on the same domain. You must be the root user to use this utility. EXAMPLES
The following example removes a volume from an active file domain called accounts_dmn. The file domain contains two volumes, /dev/disk/dsk1c and /dev/disk/dsk2c. This example removes volume /dev/disk/dsk1c from the file domain: # rmvol /dev/disk/dsk1c accounts_dmn The /etc/fdmns/accounts_dmn subdirectory now has only one entry, the entry for /dev/disk/dsk2c. The following example removes one volume from a three-volume file domain. Each volume in the accounts_dmn file domain contains one segment of /usr/myfile, which is a three-way striped file: # rmvol /dev/disk/dsk3c accounts_dmn rmvol: Removing volume '/dev/disk/dsk3c' from domain 'accounts_dmn' This volume contains one stripe segment of /usr/myfile, which will be moved to another volume in the file domain that already con- tains a stripe segment of /usr/myfile. Do you want to continue? (y/n):y One volume in the accounts_dmn file domain now contains two stripe segments of myfile, which is no longer an optimally striped file. FILES
Specifies the command path. Contains file domain names and devices. SEE ALSO
addvol(8), advfs(4), advscan(8), fdmns(4), mkfdmn(8), stripe(8) rmvol(8)
All times are GMT -4. The time now is 12:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy