Search for Multiple strings in a given date range and print the Group if they exists
Hi,
I am Searching for Multiple strings in a given date range and print the Group if they exists. the below is the format:
Code:
[2019/10/16 13:22:47.961][INFO ][ABCDDDDDDD]
-------------------------------------------------------------------------------------------------------------------------
ID: FIRST ID
MESSAGE: Event Message received.
-------------------------------------------------------------------------------------------------------------------------
CONTEXT: {
"ID" : 1,
"event" : "something",
COMMON_TEXT: COMMON
"valid" : true
}
*************************************************************************************************************************
[2019/10/16 13:23:00.816][INFO ][ABCDDDDDEEEEEEE]
-------------------------------------------------------------------------------------------------------------------------
ID: SECOND ID
MESSAGE: Event Message received.
-------------------------------------------------------------------------------------------------------------------------
CONTEXT: {
"ID" : 1,
"event" : "One More thing",
COMMON_TEXT: COMMON
"valid" : true
}
*************************************************************************************************************************
[2019/10/16 13:33:00.816][INFO ][ABCDDDDDEEFFFFFFFFFFFFFEEE]
-------------------------------------------------------------------------------------------------------------------------
ID: THIRD ID
MESSAGE: Event Message received.
-------------------------------------------------------------------------------------------------------------------------
CONTEXT: {
"ID" : 1,
"event" : "Second thing",
COMMON_TEXT: COMMON
"valid" : False
}
*************************************************************************************************************************
SED COMMAND
Code:
sed -n '/2019\/10\/23 12:2[0-2]/{:a;N;/2019\/10\/23 12:3[0-3]/!ba; /FIRST ID/p}' logfile
- This is working fine, but I wanted to give one more search criteria along with FIRST ID in the group (like something) and if both exists print the group otherwise skip the group.
Hi people
A newbie here, thrown into the deep end. I want to select the group of files with in a range of dates and perform some operation on it. Are there inbuild date libraries i can use?
I did read thru the old posts on this topic. Couldnt get much idea :(, basically want to know how I... (7 Replies)
Hi
I want to search multiple strings in a file . But the search should start with "From" Keyword and end with before "Where" keyword.
Please suggest me.
Thanks (2 Replies)
hi All,
need help. have a file like below
A, error in 123
B, log files are present
A, error in 23444
B, log files are present
A, move to next line
C, matching messages
-- expected output--
A , count =2 , error in *
A , count =1 , move to next line
B , count =2 , log files are present... (2 Replies)
Hi,
Currently I am working on a script to automate the process of converting the log file from binary into text format. To achieve this, partly I am depending on my application’s utility for this conversion and the rest I am relying on shell commands to search for directory, locate the file and... (5 Replies)
Hello I would like to ask for help with a script to search a directory that contains many log files and based on a users input after being prompted, they enter a date range down to the hour which searches the files that contain that range.
I dont know how to go about this. I am hoping that the... (5 Replies)
Hi,
I have a file filled with search strings which have a blank in between and look like this:
S. g. Ehr.
o. Jg.
v. d. Chijs
g. Ehr.
Now i would like to search for the strings and it also shall return the next column after the match.
awk -v FILE="search_strings.txt" 'BEGIN {... (10 Replies)
I have a list of files all over a file system e.g.
/home/1/foo/bar.x
/www/sites/moose/foo.txtI'm looking for strings in these files and want to replace each occurrence with a replacement string, e.g.
if I find: '#@!^\&@ in any of the files I want to replace it with: 655#@11, etc.
There... (2 Replies)
Based on the forums i have tried with grep command but i am unable to get the required output.
search this value /*------
If that is found then search for temp_vul and print
and also search until /*------- and print new_vul
Input file contains:
... (5 Replies)
I'm trying to find a way to search a range of similar words in a file. I tried using sed but can't get it right:sed 's/\(ca01\)*//'It only removes "ca01" but leaves the rest of the word. I still want the rest of the information on the lines just not these specific words listed below. Any... (3 Replies)
Discussion started by: seekryts15
3 Replies
LEARN ABOUT DEBIAN
www::search::yahoo::news::advanced
WWW::Search::Yahoo::News::Advanced(3pm) User Contributed Perl Documentation WWW::Search::Yahoo::News::Advanced(3pm)NAME
WWW::Search::Yahoo::News::Advanced - search Yahoo!News using the "advanced" interface
SYNOPSIS
use WWW::Search;
my $oSearch = new WWW::Search('Yahoo::News::Advanced');
my $sQuery = WWW::Search::escape_query("George Lucas");
$oSearch->date_from('7 days ago');
$oSearch->date_to ('now');
$oSearch->native_query($sQuery);
while (my $oResult = $oSearch->next_result())
print $oResult->url, "
";
DESCRIPTION
This class is a Yahoo! News specialization of WWW::Search. It handles making and interpreting searches on Yahoo! News
http://news.yahoo.com using the Advanced search interface.
This class exports no public interface; all interaction should be done through WWW::Search objects.
NOTES
This backend supports narrowing the search by date-range. Use date_from() and date_to() to set the endpoints of the desired date range.
You can use any date format supported by the Date::Manip module.
NOTE that Yahoo only seems to keep the last 60 days worth of news in its searchable index.
At one time, News.yahoo.com would die if the unescaped query is longer than 485 characters or so. This backend does NOT check for that.
SEE ALSO
To make new back-ends, see WWW::Search.
BUGS
To report a new bug, please use https://rt.cpan.org/Ticket/Create.html?Queue=WWW-Search-Yahoo
AUTHOR
"WWW::Search::Yahoo::News::Advanced" is maintained by Martin Thurn (mthurn@cpan.org).
LEGALESE
Copyright (C) 1998-2009 Martin 'Kingpin' Thurn
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
perl v5.12.4 2011-11-02 WWW::Search::Yahoo::News::Advanced(3pm)