<?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 on comments in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Regex-on-comments/m-p/553666#M9124</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49493"&gt;@tscroggins&lt;/a&gt;&amp;nbsp;Thats was fking awesome! what a legend thank you so much!&lt;/P&gt;</description>
    <pubDate>Sun, 30 May 2021 17:12:50 GMT</pubDate>
    <dc:creator>andres91302</dc:creator>
    <dc:date>2021-05-30T17:12:50Z</dc:date>
    <item>
      <title>Regex on comments</title>
      <link>https://community.splunk.com/t5/Reporting/Regex-on-comments/m-p/553643#M9120</link>
      <description>&lt;P&gt;Hello guys is there a way to make Splunk classify an email based on a word?&lt;BR /&gt;&lt;BR /&gt;I want all emails that contain the word "hospital" OR the word "Care" (no matter if it is uppercase or not) to be clasify as "Important" the rest as "Not important"&lt;BR /&gt;&lt;BR /&gt;Kind of like this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;Email&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;Class&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;"Hello I need a hospital bed"&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;Important&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;"Hello I can I have a quote?"&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;Not important&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The field in which email is stored may contain strings, values, and start by literally anything... is there a way to do this here?&amp;nbsp; thank you so much guys&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 May 2021 22:54:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Regex-on-comments/m-p/553643#M9120</guid>
      <dc:creator>andres91302</dc:creator>
      <dc:date>2021-05-29T22:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Regex on comments</title>
      <link>https://community.splunk.com/t5/Reporting/Regex-on-comments/m-p/553646#M9121</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232004"&gt;@andres91302&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How you do this depends on where you want the Class field to live.&lt;/P&gt;&lt;P&gt;To set Class at search time using SPL:&lt;/P&gt;&lt;P&gt;| eval Class=if(match(_raw, "(?i)(hospital|care)"), "Important", "Not important")&lt;/P&gt;&lt;P&gt;To set Class at search time using props.conf:&lt;/P&gt;&lt;P&gt;[my_sourcetype]&lt;BR /&gt;EVAL-Class = if(match(_raw, "(?i)(hospital|care)"), "Important", "Not important")&lt;/P&gt;&lt;P&gt;This assumes your mail log has a source type named &lt;EM&gt;my_sourcetype&lt;/EM&gt;. Replace this with the name of your source type.&lt;/P&gt;&lt;P&gt;To set Class at index time using props.conf, transforms.conf, and fields.conf:&lt;/P&gt;&lt;P&gt;# props.conf&lt;BR /&gt;[my_sourcetype]&lt;BR /&gt;TRANSFORMS = my_sourcetype-Class&lt;/P&gt;&lt;P&gt;# transforms.conf&lt;BR /&gt;[my_sourcetype-Class]&lt;BR /&gt;INGEST_EVAL = Class=if(match(_raw, "(?i)(hospital|care)"), "Important", "Not important")&lt;/P&gt;&lt;P&gt;# fields.conf&lt;BR /&gt;[Class]&lt;BR /&gt;INDEXED = true&lt;/P&gt;&lt;P&gt;For search time extractions, props.conf would be copied to your search head.&lt;/P&gt;&lt;P&gt;For index time extractions, props.conf and transforms.conf would be copied to your heavy forwarder or indexer and fields.conf would be copied to your search head.&lt;/P&gt;&lt;P&gt;The benefit to index time extraction is including the value of Class in the time series index of the bucket; however, you can achieve similar performance at search time by including search terms:&lt;/P&gt;&lt;P&gt;```Important```&lt;BR /&gt;sourcetype=my_sourcetype (hospital OR care)&lt;BR /&gt;| eval Class="Important"&lt;/P&gt;&lt;P&gt;```Not important```&lt;BR /&gt;sourcetype=my_sourcetype NOT (hospital OR care)&lt;BR /&gt;| eval Class="Not important"&lt;/P&gt;&lt;P&gt;Your preferred solution depends on your use cases.&lt;/P&gt;&lt;P&gt;For reference, I tested all options using the following dummy events:&lt;/P&gt;&lt;P&gt;Sat May 29 23:37:00 EDT 2021 Hello I need a hospital bed.&lt;BR /&gt;Sat May 29 23:38:00 EDT 2021 Hello I have a problem with access to care.&lt;BR /&gt;Sat May 29 23:39:00 EDT 2021 Hello I can I have a quote?&lt;BR /&gt;Sat May 29 23:40:00 EDT 2021 Hi can you help me find a provider?&lt;BR /&gt;Sat May 29 23:41:00 EDT 2021 Hello I have a question about a claim.&lt;/P&gt;&lt;P&gt;(It sounds like you're with a provider. I have a payer background....)&lt;/P&gt;</description>
      <pubDate>Sun, 30 May 2021 04:08:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Regex-on-comments/m-p/553646#M9121</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-05-30T04:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Regex on comments</title>
      <link>https://community.splunk.com/t5/Reporting/Regex-on-comments/m-p/553666#M9124</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49493"&gt;@tscroggins&lt;/a&gt;&amp;nbsp;Thats was fking awesome! what a legend thank you so much!&lt;/P&gt;</description>
      <pubDate>Sun, 30 May 2021 17:12:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Regex-on-comments/m-p/553666#M9124</guid>
      <dc:creator>andres91302</dc:creator>
      <dc:date>2021-05-30T17:12:50Z</dc:date>
    </item>
  </channel>
</rss>

