Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Search for Multiple strings in a given date range and print the Group if they exists Post 303040207 by linuxuser999 on Thursday 24th of October 2019 11:48:14 PM
Old 10-25-2019
Thanks for your reply, I am interested in
  • - first and third block (in the date and time range)
  • - searching for the text “ ‘First Id', ‘Something', ‘Third Id', ‘Second thing' ”¯. And display that group of text like below

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:33:00.816][INFO ][ABCDDDDDEEFFFFFFFFFFFFFEEE]
-------------------------------------------------------------------------------------------------------------------------
ID: THIRD ID
MESSAGE: Event Message received.
-------------------------------------------------------------------------------------------------------------------------
CONTEXT: {
  "ID" : 1,
  "event" : "Second thing",
  COMMON_TEXT: COMMON
    "valid" : False
}

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need to print file names in a certain date range using ls

I need to list only file names of a specific date from the command ls -lt. :confused: (2 Replies)
Discussion started by: Shamwari
2 Replies

2. Shell Programming and Scripting

Search files between a date range

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)
Discussion started by: zcanji
7 Replies

3. Shell Programming and Scripting

Search multiple Strings in a File

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)
Discussion started by: sboss
2 Replies

4. Shell Programming and Scripting

Search, group , print count

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)
Discussion started by: arun1401
2 Replies

5. Shell Programming and Scripting

Search for a specific data in a file based on a date range

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)
Discussion started by: svajhala
5 Replies

6. Shell Programming and Scripting

Search on date range of file based on user input

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)
Discussion started by: lostincashe
5 Replies

7. Shell Programming and Scripting

awk strings search + print next column after match

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)
Discussion started by: sdf
10 Replies

8. Shell Programming and Scripting

Search & Replace: Multiple Strings / Multiple Files

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)
Discussion started by: spacegoose
2 Replies

9. Shell Programming and Scripting

Search between two search strings and print the value

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)
Discussion started by: onesuri
5 Replies

10. UNIX for Dummies Questions & Answers

Search file and print everything except multiple search terms

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
ECACCESS-EVENT-CREATE(1p)				User Contributed Perl Documentation				 ECACCESS-EVENT-CREATE(1p)

NAME
ecaccess-event-create - Create an ECaccess Event SYNOPSIS
ecaccess-event-create -version|-help|-manual ecaccess-event-create [-debug] [-overwrite] [-public] [-comment string] event-name DESCRIPTION
Allow creating an ECaccess Event. As a result the event-id is displayed. If an event already exists with the same event-name then by default the request is rejected (please check the -overwrite option). By default an event is private and restricted to its owner. Access can however be shared with other users thanks to the ecaccess-event- grant command or with the -public option which make it visible to all. ARGUMENTS
event-name The name of the Event to create. OPTIONS
-overwrite Allow deleting an existing event with the same name and create a new one (the identifier will be however different to the original one). -public Allow creating a public event which can be used by everybody. In order to have a better tunning of the permissions please keep the event private and use the ecaccess-event-grant command instead. -comment string Specify the string to display as a comment for the event. -version Display version number and exits. -help Print a brief help message and exits. -manual Prints the manual page and exits. -debug Display the SOAP messages exchanged. EXAMPLES
ecaccess-event-create -public -comment "My Comment" "My Event Name" Create the new event with the name "My Event Name" and the comment "My Comment". This new event is public and other users can subscribe to it. SEE ALSO
ecaccess-event-grant, ecaccess-event-clear, ecaccess-event-send, ecaccess-event-list, ecaccess-event-delete and ecaccess. perl v5.14.2 2012-04-16 ECACCESS-EVENT-CREATE(1p)
All times are GMT -4. The time now is 07:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy