<?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: Need help with Regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575445#M200522</link>
    <description>&lt;P&gt;This regex will extract the VM name that follows "VNFCs" as well as the class name.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;\VNFCs":"([^"]+).*class":"([^"]+)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;To extract the specific VM and class names, this should work.&amp;nbsp; Note the changes in how the escape character is used - slashes must be escaped, but most other special character do not.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VNFCs":"(\w+-(?:ops|opslb|ntf|ntfsync|telemetry|diagnostic|db|lb)[^"]+)".*class":"(\/var\/log\/auth.log|\/var\/log\/messages.log|\/var\/log\/syslog.log|\/var\/log\/firewall\/firewall.log|\/var\/log\/audit\/audit.log)"|VNFCs":"(\w+-(ops|opslb|ntf)[^"]+).*class":"(\/opt\/function\/application.log)"|VNFCs":"(\w+-(opslb|ntfsync|telemetry|diagnostic)[^"]+).*class":"(\/opt\/log\/local1.log|\/opt\/tomcat\/server\/cm.log)"&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 18 Nov 2021 13:55:16 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2021-11-18T13:55:16Z</dc:date>
    <item>
      <title>Need help with Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575319#M200481</link>
      <description>&lt;P&gt;Hello all, kindly help with Regex..&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;I am seeing the below messages in splunkd logs. Though values are actually being extracted properly, below messages are annoying and I want to get rid of those. Need urgent help to construct a better Regex to avoid these messages. I have increased&amp;nbsp;MATCHLIMIT in transforms.conf, but still seeing these messages.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;FONT face="batang,apple gothic"&gt;11-17-2021 17:12:34.927 +1100 ERROR Regex - Failed in pcre_exec: Error PCRE_ERROR_MATCHLIMIT for regex&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;&lt;FONT face="batang,apple gothic"&gt;11-17-2021 17:12:34.927 +1100 WARN regexExtractionProcessor - Regular expression for stanza security_index exceeded configured PCRE match limit. One or more fields might not have their values extracted, which can lead to incorrect search results. Fix the regular expression to improve search performance or increase the MATCH_LIMIT in props.conf to include the missing field extractions.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Part of my regex looks like this. I have repeated the same regex corresponding to different VM and file combinations. Can someone please help with a better Regex.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;REGEX=(\VNFCs\"\:\".*(ops|opslb|ntf|ntfsync|telemetry|diagnostic|db|lb).*class\"\:\"(/var/log/auth.log|/var/log/messages.log|/var/log/syslog.log|/var/log/firewall/firewall.log|/var/log/audit/audit.log)\")..&lt;FONT color="#008000"&gt; followed by&lt;/FONT&gt;&amp;nbsp;\VNFCs\"\:\".*(ops|opslb|ntf).*class\"\:\"(/opt/function/applicatio.log)\").. &lt;FONT color="#008000"&gt;etc...&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;My Sample event is as below. There are more than 10 type of VM's (like ops,db,sync,etc), more than 300 VM's and 250 different files and I made a Single regex. I need to create regex considering below two criteria:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) &lt;STRONG&gt;&lt;FONT color="#008000"&gt;The VM's :&lt;/FONT&gt;&lt;/STRONG&gt; "xyz001vm002400-&lt;STRONG&gt;&lt;FONT color="#008000"&gt;ops&lt;/FONT&gt;&lt;/STRONG&gt;-vm01","xyz002vm002400-&lt;STRONG&gt;&lt;FONT color="#008000"&gt;db&lt;/FONT&gt;&lt;/STRONG&gt;-vm01", etc.&lt;BR /&gt;2) Log file beginning with a class keyword : &lt;STRONG&gt;&lt;FONT color="#008000"&gt;"class":"/var/log/syslog.log&lt;/FONT&gt;&lt;/STRONG&gt; , "&lt;STRONG&gt;&lt;FONT color="#008000"&gt;class":"/opt/cat/audit.log&lt;/FONT&gt; &lt;/STRONG&gt;, etc.&lt;/P&gt;&lt;P&gt;Sample Event 1:&lt;/P&gt;&lt;P&gt;{"VNFType":"xyz","VNFs":"xyz001vm002400","VNFCType":"ops","VNFCs":"xyz001vm002400-ops-vm01","event":{"log_message":"2021-11-18T02:45:01.085777+10:00, xyz001vm002400, xyz001vm002400-ops-vm01, ops, ops, info, cron, xyz001vm002400-ops-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz001vm002400, xyz001vm002400-ops-vm01, ops, ops, info, cron, xyz001vm002400-ops-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz001vm002400, xyz001vm002400-ops-vm01, ops, ops, info, cron, xyz001vm002400-ops-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz001vm002400, xyz001vm002400-ops-vm01, ops, ops, info, cron, xyz001vm002400-ops-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz001vm002400, xyz001vm002400-ops-vm01, ops, ops, info, cron, xyz001vm002400-ops-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz001vm002400, xyz001vm002400-ops-vm01, ops, ops, info, cron, xyz001vm002400-ops-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n","class":"/var/log/syslog.log","log_event_time_stamp":"2021-11-18T02:45:08+10:00"}}&lt;/P&gt;&lt;P&gt;Sample Event 2:&lt;/P&gt;&lt;P&gt;{"VNFType":"xyz","VNFs":"xyz002vm002400","VNFCType":"db","VNFCs":"xyz002vm002400-db-vm01","event":{"log_message":"2021-11-18T02:45:01.085777+10:00, xyz002vm002400, xyz002vm002400-db-vm01, db, db, info, cron, xyz002vm002400-db-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz002vm002400, xyz002vm002400-db-vm01, db, db, info, cron, xyz002vm002400-db-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz002vm002400, xyz002vm002400-db-vm01, db, db, info, cron, xyz002vm002400-db-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz002vm002400, xyz002vm002400-db-vm01, db, db, info, cron, xyz002vm002400-db-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz002vm002400, xyz002vm002400-db-vm01, db, db, info, cron, xyz002vm002400-db-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz002vm002400, xyz002vm002400-db-vm01, db, db, info, cron, xyz002vm002400-db-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n","class":"/opt/cat/audit.log","log_event_time_stamp":"2021-11-18T02:45:08+10:00"}}&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/121148"&gt;@chrisyounger&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/163905"&gt;@harsmarvania57&lt;/a&gt;&amp;nbsp; - Any help is much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 19:57:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575319#M200481</guid>
      <dc:creator>bhargavi</dc:creator>
      <dc:date>2021-11-17T19:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575346#M200487</link>
      <description>&lt;P&gt;What is the goal of the regex?&amp;nbsp; Is it to extract all VM names or just the one following "VNFs"?&amp;nbsp; Is there a pattern to VM names (perhaps xxxnnnVMnnnnnn-xx-xxnn)?&lt;/P&gt;&lt;P&gt;Please share the transforms.conf settings.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 22:02:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575346#M200487</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-11-17T22:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575366#M200493</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal to filter the events according to the VM types (like db, ops,telemetry,etc) and log file combinations and route it to different indexes.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For example, /opt/tomcat/server/cm.log might be coming from all type of VM's (around 12 VM types; VNFCs mentioned in bracket), but I want to filter the events only from few VM types, like opslb,ntfsync,telemetry,diagnostic and index them and ignore logs from other VM types.&lt;/P&gt;&lt;P&gt;VM name pattern would be like this as mentioned in the sample events : xyz002vm002400-db-vm01.xxxx.com.yy&lt;/P&gt;&lt;P&gt;A glimpse of transforms.conf&lt;/P&gt;&lt;P&gt;[security]&lt;BR /&gt;REGEX=(\VNFCs\"\:\".*(ops|opslb|ntf|ntfsync|telemetry|diagnostic|db|lb).*class\"\:\"(/var/log/auth.log|/var/log/messages.log|/var/log/syslog.log|/var/log/firewall/firewall.log|/var/log/audit/audit.log)\")|(\VNFCs\"\:\".*(ops|opslb|ntf).*class\"\:\"(/opt/function/application.log)\")|(\VNFCs\"\:\".*(opslb|ntfsync|telemetry|diagnostic).*class\"\:\"(/opt/log/local1.log|/opt/tomcat/server/cm.log)\")&lt;BR /&gt;DEST_KEY=_MetaData:Index&lt;BR /&gt;FORMAT=model_sec&lt;BR /&gt;WRITE_META=true&lt;BR /&gt;LOOKAHEAD=60000&lt;/P&gt;&lt;P&gt;Sample Event 1: {"VNFType":"xyz","VNFs":"xyz002vm002400","VNFCType":"db","VNFCs":"xyz002vm002400-db-vm01.xxxx.com.yy","event":{"log_message":"2021-11-18T02:45:01.085777+10:00, xyz002vm002400, xyz002vm002400-db-vm01, db, db, info, cron, xyz002vm002400-db-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz002vm002400, xyz002vm002400-db-vm01.xxxx.com.yy, db, db, info, cron, xyz002vm002400-db-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz002vm002400, xyz002vm002400-db-vm01.xxxx.com.yy, db, db, info, cron, xyz002vm002400-db-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz002vm002400, xyz002vm002400-db-vm01, db, db, info, cron, xyz002vm002400-db-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz002vm002400, xyz002vm002400-db-vm01.xxxx.com.yy, db, db, info, cron, xyz002vm002400-db-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, xyz002vm002400, xyz002vm002400-db-vm01, db, db, info, cron, xyz002vm002400-db-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n","class":"/var/log/audit.log","log_event_time_stamp":"2021-11-18T02:45:08+10:00"}}&lt;/P&gt;&lt;P&gt;Sample Event 2:&lt;/P&gt;&lt;P&gt;{"VNFType":"xyz","VNFs":"abc002vm002400","VNFCType":"telemetry","VNFCs":"abc002vm002400-telemetry-vm01.xxxx.com.yy","event":{"log_message":"2021-11-18T02:45:01.085777+10:00, abc002vm002400, abc002vm002400-telemetry-vm01, telemetry, telemetry, info, cron, abc002vm002400-telemetry-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, abc002vm002400, abc002vm002400-telemetry-vm01.xxxx.com.yy, telemetry, telemetry, info, cron, abc002vm002400-telemetry-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, abc002vm002400, abc002vm002400-telemetry-vm01.xxxx.com.yy, telemetry, telemetry, info, cron, abc002vm002400-telemetry-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, abc002vm002400, abc002vm002400-telemetry-vm01, telemetry, telemetry, info, cron, abc002vm002400-telemetry-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, abc002vm002400, abc002vm002400-telemetry-vm01.xxxx.com.yy, telemetry, telemetry, info, cron, abc002vm002400-telemetry-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n2021-11-18T02:45:01.085777+10:00, abc002vm002400, abc002vm002400-telemetry-vm01.xxxx.com.yy, telemetry, telemetry, info, cron, abc002vm002400-telemetry-vm01, CROND[16311]:, (root) CMD (/usr/sbin/KillIdleSessions)\n","class":"/opt/log/local1.log","log_event_time_stamp":"2021-11-18T02:45:08+10:00"}}&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 05:20:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575366#M200493</guid>
      <dc:creator>bhargavi</dc:creator>
      <dc:date>2021-11-18T05:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575445#M200522</link>
      <description>&lt;P&gt;This regex will extract the VM name that follows "VNFCs" as well as the class name.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;\VNFCs":"([^"]+).*class":"([^"]+)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;To extract the specific VM and class names, this should work.&amp;nbsp; Note the changes in how the escape character is used - slashes must be escaped, but most other special character do not.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VNFCs":"(\w+-(?:ops|opslb|ntf|ntfsync|telemetry|diagnostic|db|lb)[^"]+)".*class":"(\/var\/log\/auth.log|\/var\/log\/messages.log|\/var\/log\/syslog.log|\/var\/log\/firewall\/firewall.log|\/var\/log\/audit\/audit.log)"|VNFCs":"(\w+-(ops|opslb|ntf)[^"]+).*class":"(\/opt\/function\/application.log)"|VNFCs":"(\w+-(opslb|ntfsync|telemetry|diagnostic)[^"]+).*class":"(\/opt\/log\/local1.log|\/opt\/tomcat\/server\/cm.log)"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 18 Nov 2021 13:55:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575445#M200522</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-11-18T13:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575534#M200552</link>
      <description>&lt;P&gt;Thank you very much for the reply&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried updating regex in the below pattern mentioned by you,but still receiving error messages in splunkd logs.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bhargavi_0-1637265286636.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16921iB793C701C91F53BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bhargavi_0-1637265286636.png" alt="bhargavi_0-1637265286636.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 19:55:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575534#M200552</guid>
      <dc:creator>bhargavi</dc:creator>
      <dc:date>2021-11-18T19:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575545#M200558</link>
      <description>&lt;P&gt;I'm not sure what else to suggest.&amp;nbsp; That regex is about 20x more efficient than the original.&amp;nbsp; If Splunk still isn't happy then perhaps you should consider using multiple REGEX attributes, one for each pipe in the current regex.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 20:51:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Regex/m-p/575545#M200558</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-11-18T20:51:27Z</dc:date>
    </item>
  </channel>
</rss>

