<?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: Regex Help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421861#M168485</link>
    <description>&lt;P&gt;Thanks.  I tried this but unfortunately it's not parsing the field.  See the previous comment for my search.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jul 2018 21:51:45 GMT</pubDate>
    <dc:creator>bschaap</dc:creator>
    <dc:date>2018-07-05T21:51:45Z</dc:date>
    <item>
      <title>Regex Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421857#M168481</link>
      <description>&lt;P&gt;I'm trying to parse out the exception type and exception message from the DB Connect dbx_server logs.  I'm having some difficulty with this and have tried regex101.com and am able to come up with a regex that parses it but cannot get it to work using the rex command in Splunk.  In the sample event below, I am trying to parse out "java.io.IOException" and "HTTP Error 503: Service Unavailable".&lt;/P&gt;

&lt;P&gt;From regex101 for the exception message -&lt;BR /&gt;
Exception: (?P.+? at)&lt;/P&gt;

&lt;P&gt;Event -&lt;BR /&gt;
2018-07-05 16:21:05.528 -0400 [QuartzScheduler_Worker-21] ERROR c.s.d.s.task.listeners.RecordWriterMetricsListener - action=unable_to_write_batch java.io.IOException: HTTP Error 503: Service Unavailable at com.splunk.dbx.server.dbinput.recordwriter.HttpEventCollector.uploadEventBatch(HttpEventCollector.java:112) at com.splunk.dbx.server.dbinput.recordwriter.HttpEventCollector.uploadEvents(HttpEventCollector.java:89) at com.splunk.dbx.server.dbinput.recordwriter.HecEventWriter.writeRecords(HecEventWriter.java:36) at org.easybatch.core.job.BatchJob.writeBatch(BatchJob.java:203) at org.easybatch.core.job.BatchJob.call(BatchJob.java:79) at org.easybatch.extensions.quartz.Job.execute(Job.java:59) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) 2018-07-05 16:21:05.528 -0400 [QuartzScheduler_Worker-21] ERROR c.s.d.s.dbinput.recordwriter.CheckpointUpdater - action=skip_checkpoint_update_batch_writing_failed java.io.IOException: HTTP Error 503: Service Unavailable at com.splunk.dbx.server.dbinput.recordwriter.HttpEventCollector.uploadEventBatch(HttpEventCollector.java:112) at com.splunk.dbx.server.dbinput.recordwriter.HttpEventCollector.uploadEvents(HttpEventCollector.java:89) at com.splunk.dbx.server.dbinput.recordwriter.HecEventWriter.writeRecords(HecEventWriter.java:36) at org.easybatch.core.job.BatchJob.writeBatch(BatchJob.java:203) at org.easybatch.core.job.BatchJob.call(BatchJob.java:79) at org.easybatch.extensions.quartz.Job.execute(Job.java:59) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:17:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421857#M168481</guid>
      <dc:creator>bschaap</dc:creator>
      <dc:date>2020-09-29T20:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421858#M168482</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your base search
| rex "^(\S+\s+){8}(?P&amp;lt;Exception_Type&amp;gt;[^\:]+):\s*(?&amp;lt;Exception_Message&amp;gt;.+? at)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Jul 2018 21:14:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421858#M168482</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-07-05T21:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421859#M168483</link>
      <description>&lt;P&gt;Hi @bschaap&lt;/P&gt;

&lt;P&gt;Take a look at this&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5310i8E215104FA1EEBA3/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;if you want to do it in rex command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;java.io.IOException:(?P&amp;lt;fieldname&amp;gt;.*?) at
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 21:27:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421859#M168483</guid>
      <dc:creator>PowerPacked</dc:creator>
      <dc:date>2018-07-05T21:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421860#M168484</link>
      <description>&lt;P&gt;Thanks.  I tried this but unfortunately it's not parsing the field.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Results&lt;/STRONG&gt;&lt;BR /&gt;
"_time",fieldname,"Exception_Type","Exception_Message"&lt;BR /&gt;
"2018-07-05T17:47:08.000-0400",,,&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Search&lt;/STRONG&gt;&lt;BR /&gt;
| makeresults &lt;BR /&gt;
| eval raw = "2018-07-05 16:21:05.528 -0400 [QuartzScheduler_Worker-21] ERROR c.s.d.s.task.listeners.RecordWriterMetricsListener - action=unable_to_write_batch java.io.IOException: HTTP Error 503: Service Unavailable at com.splunk.dbx.server.dbinput.recordwriter.HttpEventCollector.uploadEventBatch(HttpEventCollector.java:112) at com.splunk.dbx.server.dbinput.recordwriter.HttpEventCollector.uploadEvents(HttpEventCollector.java:89) at com.splunk.dbx.server.dbinput.recordwriter.HecEventWriter.writeRecords(HecEventWriter.java:36) at org.easybatch.core.job.BatchJob.writeBatch(BatchJob.java:203) at org.easybatch.core.job.BatchJob.call(BatchJob.java:79) at org.easybatch.extensions.quartz.Job.execute(Job.java:59) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) 2018-07-05 16:21:05.528 -0400 [QuartzScheduler_Worker-21] ERROR c.s.d.s.dbinput.recordwriter.CheckpointUpdater - action=skip_checkpoint_update_batch_writing_failed java.io.IOException: HTTP Error 503: Service Unavailable at com.splunk.dbx.server.dbinput.recordwriter.HttpEventCollector.uploadEventBatch(HttpEventCollector.java:112) at com.splunk.dbx.server.dbinput.recordwriter.HttpEventCollector.uploadEvents(HttpEventCollector.java:89) at com.splunk.dbx.server.dbinput.recordwriter.HecEventWriter.writeRecords(HecEventWriter.java:36) at org.easybatch.core.job.BatchJob.writeBatch(BatchJob.java:203) at org.easybatch.core.job.BatchJob.call(BatchJob.java:79) at org.easybatch.extensions.quartz.Job.execute(Job.java:59) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)"&lt;BR /&gt;
| rex "java.io.IOException:(?P.&lt;EM&gt;?) at"&lt;BR /&gt;
| rex "^(\S+\s+){8}(?P[^:]+):\s&lt;/EM&gt;(?.+? at)"&lt;BR /&gt;
| table _time fieldname Exception_Type Exception_Message&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:17:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421860#M168484</guid>
      <dc:creator>bschaap</dc:creator>
      <dc:date>2020-09-29T20:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421861#M168485</link>
      <description>&lt;P&gt;Thanks.  I tried this but unfortunately it's not parsing the field.  See the previous comment for my search.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 21:51:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421861#M168485</guid>
      <dc:creator>bschaap</dc:creator>
      <dc:date>2018-07-05T21:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421862#M168486</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;Adding  new answer, as i cant post image in comments.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5313iDC2EF31BCED52654/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 22:06:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Help/m-p/421862#M168486</guid>
      <dc:creator>PowerPacked</dc:creator>
      <dc:date>2018-07-05T22:06:44Z</dc:date>
    </item>
  </channel>
</rss>

