Skip to main content
edited body
Source Link
a_subscriber
  • 4.4k
  • 3
  • 25
  • 69

Suppose I have the next log file:

2023-09-17 00:59:00.245 Start ... here many lines of text#1 (about 1000 lines of text) 2024-02-23 18:48:06.692 INFO [MyClass:myExecutor-3] Some process - enter to step 3 ... here many lines of text#2 (about 20006000 lines of text) 2024-02-23 19:38:49.056 INFO [MyClass:myExecutor-4] Some process - complete the process ... here many lines of text#3 (about 3000 lines of text) 

I need to to show lines of logs only between this 2 lines:

2024-02-23 18:48:06.692 INFO [MyClass:myExecutor-3] Some process - enter to step 3 2024-02-23 19:38:49.056 INFO [MyClass:myExecutor-4] Some process - complete the process 

As result must show only this:

... here many lines of text#2 (about 20006000 lines of text) 

Is it possible?

Suppose I have the next log file:

2023-09-17 00:59:00.245 Start ... here many lines of text#1 (about 1000 lines of text) 2024-02-23 18:48:06.692 INFO [MyClass:myExecutor-3] Some process - enter to step 3 ... here many lines of text#2 (about 2000 lines of text) 2024-02-23 19:38:49.056 INFO [MyClass:myExecutor-4] Some process - complete the process ... here many lines of text#3 (about 3000 lines of text) 

I need to to show lines of logs only between this 2 lines:

2024-02-23 18:48:06.692 INFO [MyClass:myExecutor-3] Some process - enter to step 3 2024-02-23 19:38:49.056 INFO [MyClass:myExecutor-4] Some process - complete the process 

As result must show only this:

... here many lines of text#2 (about 2000 lines of text) 

Is it possible?

Suppose I have the next log file:

2023-09-17 00:59:00.245 Start ... here many lines of text#1 (about 1000 lines of text) 2024-02-23 18:48:06.692 INFO [MyClass:myExecutor-3] Some process - enter to step 3 ... here many lines of text#2 (about 6000 lines of text) 2024-02-23 19:38:49.056 INFO [MyClass:myExecutor-4] Some process - complete the process ... here many lines of text#3 (about 3000 lines of text) 

I need to to show lines of logs only between this 2 lines:

2024-02-23 18:48:06.692 INFO [MyClass:myExecutor-3] Some process - enter to step 3 2024-02-23 19:38:49.056 INFO [MyClass:myExecutor-4] Some process - complete the process 

As result must show only this:

... here many lines of text#2 (about 6000 lines of text) 

Is it possible?

Source Link
a_subscriber
  • 4.4k
  • 3
  • 25
  • 69

Show text between two lines

Suppose I have the next log file:

2023-09-17 00:59:00.245 Start ... here many lines of text#1 (about 1000 lines of text) 2024-02-23 18:48:06.692 INFO [MyClass:myExecutor-3] Some process - enter to step 3 ... here many lines of text#2 (about 2000 lines of text) 2024-02-23 19:38:49.056 INFO [MyClass:myExecutor-4] Some process - complete the process ... here many lines of text#3 (about 3000 lines of text) 

I need to to show lines of logs only between this 2 lines:

2024-02-23 18:48:06.692 INFO [MyClass:myExecutor-3] Some process - enter to step 3 2024-02-23 19:38:49.056 INFO [MyClass:myExecutor-4] Some process - complete the process 

As result must show only this:

... here many lines of text#2 (about 2000 lines of text) 

Is it possible?