<?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: Capture groups extracting empty values from log messages in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683068#M233295</link>
    <description>&lt;P&gt;This regex works with the sample events and is much more efficient according to regex101.com.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;mydatetime&amp;gt;[^,]+),severity=(?&amp;lt;severity&amp;gt;[^,]+),thread=(?&amp;lt;thread&amp;gt;[^,]+),logger=(?&amp;lt;logger&amp;gt;[^,]+),\{\},(?&amp;lt;logmsg&amp;gt;.*)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 16:17:59 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2024-04-03T16:17:59Z</dc:date>
    <item>
      <title>Capture groups extracting empty values from log messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683047#M233289</link>
      <description>&lt;P&gt;Requesting help with search query. I have application logs in Splunk like,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;2024-04-02T12:26:02.244-04:00,severity=DEBUG,thread=main,logger=org.apache.catalina.core.NamingContextListener,{},Creating JNDI naming context&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;2024-04-02T12:26:02.118-04:00,severity=DEBUG,thread=main,logger=org.apache.catalina.core.NamingContextListener,{}, Adding resource ref UserDatabase ResourceRef[className=org.apache.catalina.UserDatabase,factoryClassLocation=null,factoryClassName=org.apache.naming.factory.ResourceFactory,{type=description,content=User database that can be updated and saved},{type=scope,content=Shareable},{type=auth,content=Container},{type=singleton,content=true},{type=factory,content=org.apache.catalina.users.MemoryUserDatabaseFactory},{type=pathname,content=conf/tomcat-users.xml}]&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;And I'm using following query to separate different sections of the message,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;index=my_app_index AND source="**/my-app-service.log" AND sourcetype="app_v1"|rex="(?&amp;lt;mydatetime&amp;gt;^\S*)\,severity=(?&amp;lt;severity&amp;gt;\S*)\,thread=(?&amp;lt;thread&amp;gt;\S*)\,logger=(?&amp;lt;logger&amp;gt;\S*)\,\{\}\,(?&amp;lt;logmsg&amp;gt;(.)*)"|table mydatetime,logger,thread,_raw,logmsg|rename logmsg AS MESSAGE&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;What I see is,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;column mydatetime and logmsg(MESSAGE) are empty.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;What I expect is,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;column mydatetime contain initial date-time, and logmsg(MESSAGE)&amp;nbsp; contain the last message part&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%"&gt;mydatetime&lt;/TD&gt;&lt;TD width="25%"&gt;logger&lt;/TD&gt;&lt;TD width="25%"&gt;thread&lt;/TD&gt;&lt;TD width="25%"&gt;logmsg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;2024-04-02T12:26:02.244-04:00&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;org.apache.catalina.core.NamingContextListener&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;main&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;Creating JNDI naming context&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;2024-04-02T12:26:02.118-04:00&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;org.apache.catalina.core.NamingContextListener&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;main&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;Adding resource ref UserDatabase ResourceRef[className=org.apache.catalina.UserDatabase,factoryClassLocation=null,factoryClassName=org.apache.naming.factory.ResourceFactory,{type=description,content=User database that can be updated and saved},{type=scope,content=Shareable},{type=auth,content=Container},{type=singleton,content=true},{type=factory,content=org.apache.catalina.users.MemoryUserDatabaseFactory},{type=pathname,content=conf/tomcat-users.xml}]&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 03 Apr 2024 14:47:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683047#M233289</guid>
      <dc:creator>search_in_splun</dc:creator>
      <dc:date>2024-04-03T14:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Capture groups extracting empty values from log messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683055#M233291</link>
      <description>&lt;P&gt;You don't need the = after the rex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;mydatetime&amp;gt;^\S*)\,severity=(?&amp;lt;severity&amp;gt;\S*)\,thread=(?&amp;lt;thread&amp;gt;\S*)\,logger=(?&amp;lt;logger&amp;gt;\S*)\,\{\}\,(?&amp;lt;logmsg&amp;gt;.*)"&lt;/LI-CODE&gt;&lt;P&gt;Updated to remove brackets in the logmsg pattern&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 21:02:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683055#M233291</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-03T21:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Capture groups extracting empty values from log messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683058#M233292</link>
      <description>&lt;P&gt;Yes indeed it does solve the issue, but now there's a new issue&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Streamed search execute failed because: Error in 'rex' command: regex="(?&amp;lt;mydatetime&amp;gt;^\S*)\,severity=(?&amp;lt;severity&amp;gt;\S*)\,thread=(?&amp;lt;thread&amp;gt;\S*)\,logger=(?&amp;lt;logger&amp;gt;\S*)\,\{\}\,(?&amp;lt;logmsg&amp;gt;(.)*)" has exceeded the configured depth_limit, consider raising the value in limits.conf..&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 15:41:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683058#M233292</guid>
      <dc:creator>search_in_splun</dc:creator>
      <dc:date>2024-04-03T15:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Capture groups extracting empty values from log messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683067#M233294</link>
      <description>&lt;P&gt;Again, what's with the = after the regex? Is this just a typo?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 16:17:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683067#M233294</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-03T16:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Capture groups extracting empty values from log messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683068#M233295</link>
      <description>&lt;P&gt;This regex works with the sample events and is much more efficient according to regex101.com.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;mydatetime&amp;gt;[^,]+),severity=(?&amp;lt;severity&amp;gt;[^,]+),thread=(?&amp;lt;thread&amp;gt;[^,]+),logger=(?&amp;lt;logger&amp;gt;[^,]+),\{\},(?&amp;lt;logmsg&amp;gt;.*)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 16:17:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683068#M233295</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-04-03T16:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Capture groups extracting empty values from log messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683069#M233296</link>
      <description>&lt;P&gt;I re-checked by putting the rex you've provided once again without the equal(=) symbol, but surprisingly the error message comes back with words 'regex='&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 16:23:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683069#M233296</guid>
      <dc:creator>search_in_splun</dc:creator>
      <dc:date>2024-04-03T16:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Capture groups extracting empty values from log messages</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683070#M233297</link>
      <description>&lt;P&gt;And this rex doesn't produce any error&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 16:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capture-groups-extracting-empty-values-from-log-messages/m-p/683070#M233297</guid>
      <dc:creator>search_in_splun</dc:creator>
      <dc:date>2024-04-03T16:26:07Z</dc:date>
    </item>
  </channel>
</rss>

