Sponsored Content
Top Forums Shell Programming and Scripting Find keywords in multiple log files Post 302974645 by Don Cragun on Wednesday 1st of June 2016 07:39:36 PM
Old 06-01-2016
Maybe you should consider the questions I asked and the comments RudiC made as suggestions for things to change in your code to make it work correctly and avoid the problems you are having. If you try fixing those problems in your code and are still having problems, come back to us and:
  1. Tell us what operating system you're using.
  2. Tell us what shell you're using.
  3. Clearly describe the format of the input and output files you are processing? (Are they UNIX format text files? If not, why not and what format are they?)
  4. Show us sample input files (in CODE tags).
  5. Show us sample output files showing the exact output you are trying to produce from your sample input files (in CODE tags).
  6. A CLEAR specification of what you are trying to do (using filenames in your specification that match the sample input and output files specified above.)
  7. Show us your updated code (in CODE tags).
  8. Show us all of the diagnostic messages that are being produced from your code (in CODE tags). (And, don't tell us that mailx is failing when your script died long before it got to mailx.)
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find particular string in multiple files

Hello friends, I have find a paticular string from the files present in my user for example: a username and password is hardcoded in multiple files which present in the my user.so I have to search about username in which files it is available.there are several dirctories are there,so... (5 Replies)
Discussion started by: sivaranga001
5 Replies

2. Shell Programming and Scripting

Finding 50k Keywords in 3k files

Hi, I have a file with about 50k keywords. I have a requirement to scan about 3k files to identify which filename has which keyword i.e. an output like following: File1,Keyword1 File1,Keyword2 File3,Keyword1 ..... I have written a shell script which takes each of the 3k files, searches... (4 Replies)
Discussion started by: rjains
4 Replies

3. Shell Programming and Scripting

Script to find & replace a multiple lines string across multiple php files and subdirectories

Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ? The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories. So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Discussion started by: spfc_dmt
12 Replies

4. UNIX for Dummies Questions & Answers

finding keywords in many files using grep

Hi to all Sorry for the confusion because I did not explain the task clearly. There are many .hhr files in a folder There are so many lines in these .hhr files but I want only the following 2 lines to be transferred to the output file. The keyword No 1 and all the words in the next line They... (5 Replies)
Discussion started by: raghulrajan
5 Replies

5. UNIX for Advanced & Expert Users

Need to search for keywords within files modified at a certain time

I have a huge list of files in an Unix directory (around 10000 files). I need to be able to search for a certain keyword only within files that are modified between certain date and time, say for e.g 2012-08-20 12:30 to 2012-08-20 12:40 Can someone let me know what would be the fastest way... (10 Replies)
Discussion started by: virtual123
10 Replies

6. Shell Programming and Scripting

Find keywords, and append at the end of line

Task: Find keywords in each line, and append at the end of line; if not found in the line, do nothing. the code is wrong. how to make it work. thanks a lot. cat keywords.txt | while read line; do awk -F"|" '{if (/$line/) {print $0"$line , ";} else print;}' outfile.txt > tmp ... (9 Replies)
Discussion started by: dtdt
9 Replies

7. Shell Programming and Scripting

Search files in directory for keywords using bash

I have ~100 text files in a directory that I am trying to parse and output to a new file. I am looking for the words chr,start,stop,ref,alt in each of the files. Those fields should appear somewhere in those files. The first two fields of each new set of rows is also printed. Since this is on a... (7 Replies)
Discussion started by: cmccabe
7 Replies

8. UNIX for Dummies Questions & Answers

Find keywords in multiple log files

The Problem that I am having is when the code ran and populated the progflag.csv file, columns MEMSIZE, SECOND and SASEXE were blank. The next problems are the IF else statement isn't working and the email function isn't sending the progflag.csv attachment. a. What I want the program to do is to... (2 Replies)
Discussion started by: dellanicholson
2 Replies

9. Shell Programming and Scripting

Grep multiple keywords from a file

I have a script that will search for a keyword in all the log files. It work just fine. LOG_FILES={ "/Sandbox/logs/*" } for file in ${LOG_FILES}; do grep $1 $file done This only works for 1 keyword. What if I want to search for more then 1 keywords, say 4 or maybe even... (10 Replies)
Discussion started by: Loc
10 Replies

10. UNIX for Beginners Questions & Answers

Find and replace from multiple files

Hello everybody, I need your help. I have a php site that was expoited, the hacker has injected into many php files a phishing code that was discovered and removed in order to have again a clean code. Now we need to remove from many php files that malware. I need to create a script that find and... (2 Replies)
Discussion started by: ninocap
2 Replies
lookbib(1)						      General Commands Manual							lookbib(1)

Name
       indxbib, lookbib - build inverted index for a bibliography, lookup bibliographic references

Syntax
       indxbib database...
       lookbib database

Description
       The  makes  an inverted index to the named databases (or files) for use by and These files contain bibliographic references (or other kinds
       of information) separated by blank lines.

       A bibliographic reference is a set of lines, constituting fields of bibliographic information.  Each field starts on a line beginning  with
       a  ``%'',  followed  by	a key-letter, then a blank, and finally the contents of the field, which may continue until the next line starting
       with ``%''.

       The command is a shell script that calls and The first program, truncates words to 6 characters, and maps upper case  to  lower	case.	It
       also  discards words shorter than 3 characters, words among the 100 most common English words, and numbers (dates) < 1900 or > 2000.  These
       parameters can be changed.  The second program, inv, creates an entry file (.ia), a posting file (.ib), and a tag file (.ic),  all  in  the
       working directory.

       The command uses an inverted index made by to find sets of bibliographic references.  It reads keywords typed after the ``>'' prompt on the
       terminal, and retrieves records containing all these keywords.  If nothing matches, nothing is returned except another ``>'' prompt.

       It is possible to search multiple databases, as long as they have a common index made by In that case, only the first argument given to	is
       specified to

       If  does  not  find the index files (the .i[abc] files), it looks for a reference file with the same name as the argument, without the suf-
       fixes.  It creates a file with a '.ig' suffix, suitable for use with It then uses this fgrep file to find references.  This method is  sim-
       pler to use, but the .ig file is slower to use than the .i[abc] files, and does not allow the use of multiple reference files.

Files
       x.ia, x.ib, x.ic, where x is the first argument, or if these are not present, then x.ig, x

See Also
       addbib(1), lookbib(1), refer(1), roffbib(1), sortbib(1),

																	lookbib(1)
All times are GMT -4. The time now is 11:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy