<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Logs between &amp;quot;string1&amp;quot;  and  &amp;quot;string2&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565972#M197216</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/61125"&gt;@shivanshu1593&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the below sample.&lt;/P&gt;&lt;P&gt;I want to extract the logs between "&lt;STRONG&gt;Abc fgh, app continuing" &lt;/STRONG&gt;and &lt;STRONG&gt;"started in". &lt;/STRONG&gt;If there are "ERROR" or "SEVERE" keywords in the extracted logs, then I want to print that&amp;nbsp; "ERROR" or "SEVERE" line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2021-08-31 02:03:52,081 INFO [stdout] jkwqdwqjdk&lt;BR /&gt;2021-08-31 02:03:52,081 INFO [stdout] (ServerService Thread Pool -- 83)&lt;BR /&gt;2021-08-31 02:03:52,081 INFO [stdout] (ServerService Thread Pool -- 83) &lt;STRONG&gt;Abc fgh, app continuing&lt;/STRONG&gt;&lt;BR /&gt;2021-08-31 02:03:52,081 INFO [stdout] (ServerService Thread Pool -- 83)&lt;/P&gt;&lt;P&gt;2021-08-31 02:03:52,081 INFO [stdout] (ServerService Thread Pool -- 83)kwqskqw&lt;BR /&gt;2021-08-31 02:03:52,081 INFO [stdout] (ServerService Thread Pool -- 83)&lt;BR /&gt;2021-08-31 02:03:52,081 INFO [org.kjskj.akjs] (ServerService Thread Pool -- 11) WFLYUT0021: Registered web context: '/dyn' for server 'default-server'&lt;BR /&gt;2021-08-31 02:03:52,081 &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ERROR&lt;/STRONG&gt; &lt;/FONT&gt;[org.kjskj.akjs] "There is an error"&lt;BR /&gt;2021-08-31 02:03:52,081 &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;SEVERE&lt;/FONT&gt; &lt;/STRONG&gt;[org.kjskj.akjs] There is Severe&lt;BR /&gt;2021-08-31 02:03:55,166 INFO [org.jboss.as] (Controller Boot Thread) WAAAAAA0033: JBoss EAP 1.1.9.GA (abcfegc Core 2.0.10.Final-call-00000) &lt;STRONG&gt;started in&lt;/STRONG&gt; 169999ms - Started 2222 of 2222 services (311 services are lazy, passive or on-demand)&lt;BR /&gt;2021-08-31 02:03:55,169 INFO [org.jboss.as] (aa nnnThread) WAAAAAA0033: Http interface listening on &lt;A href="http://111.11.11.11:8080/aaa" target="_blank"&gt;http://111.11.11.11:8080/aaa&lt;/A&gt;&lt;BR /&gt;2021-08-31 02:03:55,169 INFO [org.nnn.as] (ioio llkl Thread) WAAAAAA0033: console listening on &lt;A href="http://111.11.11.11:8080/aaa" target="_blank"&gt;http://111.11.11.11:8080/aaa&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Sep 2021 06:02:25 GMT</pubDate>
    <dc:creator>VS0909</dc:creator>
    <dc:date>2021-09-06T06:02:25Z</dc:date>
    <item>
      <title>Logs between "string1"  and  "string2"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565826#M197157</link>
      <description>&lt;P&gt;I have to find logs between "string1"&amp;nbsp;&amp;nbsp;and&amp;nbsp; "string2" in Splunk for index=abc. Then I need to verify if there is any "Error" or "Severe" word displayed in those logs.&lt;/P&gt;&lt;P&gt;Can someone please help with the Splunk query?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 15:27:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565826#M197157</guid>
      <dc:creator>VS0909</dc:creator>
      <dc:date>2021-09-03T15:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Logs between "string1"  and  "string2"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565828#M197159</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225618"&gt;@VS0909&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Could you share some sample data and desired output as to what you're expecting. We can help to build the query.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;So&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 15:35:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565828#M197159</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2021-09-03T15:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Logs between "string1"  and  "string2"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565897#M197178</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225618"&gt;@VS0909&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/61125"&gt;@shivanshu1593&lt;/a&gt; said, we could be more precise having a sample of your logs, anyway, the regex to extract a field between two strings it's easy:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "string1(?&amp;lt;your_field&amp;gt;.*)string2"&lt;/LI-CODE&gt;&lt;P&gt;beware when you write the strings because regexes are case sensitive.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 09:14:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565897#M197178</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-09-04T09:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Logs between "string1"  and  "string2"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565972#M197216</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/61125"&gt;@shivanshu1593&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the below sample.&lt;/P&gt;&lt;P&gt;I want to extract the logs between "&lt;STRONG&gt;Abc fgh, app continuing" &lt;/STRONG&gt;and &lt;STRONG&gt;"started in". &lt;/STRONG&gt;If there are "ERROR" or "SEVERE" keywords in the extracted logs, then I want to print that&amp;nbsp; "ERROR" or "SEVERE" line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2021-08-31 02:03:52,081 INFO [stdout] jkwqdwqjdk&lt;BR /&gt;2021-08-31 02:03:52,081 INFO [stdout] (ServerService Thread Pool -- 83)&lt;BR /&gt;2021-08-31 02:03:52,081 INFO [stdout] (ServerService Thread Pool -- 83) &lt;STRONG&gt;Abc fgh, app continuing&lt;/STRONG&gt;&lt;BR /&gt;2021-08-31 02:03:52,081 INFO [stdout] (ServerService Thread Pool -- 83)&lt;/P&gt;&lt;P&gt;2021-08-31 02:03:52,081 INFO [stdout] (ServerService Thread Pool -- 83)kwqskqw&lt;BR /&gt;2021-08-31 02:03:52,081 INFO [stdout] (ServerService Thread Pool -- 83)&lt;BR /&gt;2021-08-31 02:03:52,081 INFO [org.kjskj.akjs] (ServerService Thread Pool -- 11) WFLYUT0021: Registered web context: '/dyn' for server 'default-server'&lt;BR /&gt;2021-08-31 02:03:52,081 &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ERROR&lt;/STRONG&gt; &lt;/FONT&gt;[org.kjskj.akjs] "There is an error"&lt;BR /&gt;2021-08-31 02:03:52,081 &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;SEVERE&lt;/FONT&gt; &lt;/STRONG&gt;[org.kjskj.akjs] There is Severe&lt;BR /&gt;2021-08-31 02:03:55,166 INFO [org.jboss.as] (Controller Boot Thread) WAAAAAA0033: JBoss EAP 1.1.9.GA (abcfegc Core 2.0.10.Final-call-00000) &lt;STRONG&gt;started in&lt;/STRONG&gt; 169999ms - Started 2222 of 2222 services (311 services are lazy, passive or on-demand)&lt;BR /&gt;2021-08-31 02:03:55,169 INFO [org.jboss.as] (aa nnnThread) WAAAAAA0033: Http interface listening on &lt;A href="http://111.11.11.11:8080/aaa" target="_blank"&gt;http://111.11.11.11:8080/aaa&lt;/A&gt;&lt;BR /&gt;2021-08-31 02:03:55,169 INFO [org.nnn.as] (ioio llkl Thread) WAAAAAA0033: console listening on &lt;A href="http://111.11.11.11:8080/aaa" target="_blank"&gt;http://111.11.11.11:8080/aaa&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 06:02:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565972#M197216</guid>
      <dc:creator>VS0909</dc:creator>
      <dc:date>2021-09-06T06:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Logs between "string1"  and  "string2"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565977#M197218</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225618"&gt;@VS0909&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;viewing you logs, it's a different situation: you don't need a regex to extract a field, you need to correlate many events!&lt;/P&gt;&lt;P&gt;Anyway, try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| transaction startswith="Abc fgh, app continuing" endswith="started in"
| rex "(?&amp;lt;error_level&amp;gt;ERROR|SEVERE)"
| table _time error_level&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 07:15:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565977#M197218</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-09-06T07:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Logs between "string1"  and  "string2"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565982#M197222</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp; Thanks for the reply&lt;/P&gt;&lt;P&gt;I also want to print the line in the extracted Error or SEVERE line.&lt;/P&gt;&lt;P&gt;Can you pls help with that.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 08:05:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565982#M197222</guid>
      <dc:creator>VS0909</dc:creator>
      <dc:date>2021-09-06T08:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Logs between "string1"  and  "string2"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565983#M197223</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225618"&gt;@VS0909&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;ok, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| transaction startswith="Abc fgh, app continuing" endswith="started in"
| rex "^(?&amp;lt;event&amp;gt;\d+-\d+-\d+\s+\d+:\d+:\d+,\d+\s(ERROR|SEVERE).*)"
| table _time event&lt;/LI-CODE&gt;&lt;P&gt;you can test the regex at&amp;nbsp;&lt;A href="https://regex101.com/r/oid94M/1" target="_blank"&gt;https://regex101.com/r/oid94M/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you want also the error level and the timestamp of the single event, you can use another regex to extract them.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 08:13:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Logs-between-quot-string1-quot-and-quot-string2-quot/m-p/565983#M197223</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-09-06T08:13:38Z</dc:date>
    </item>
  </channel>
</rss>

