<?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: How to adjust search to include names that are also hyphenated in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493406#M137628</link>
    <description>&lt;P&gt;In this search, we split the user_name field into first and last name then convert to upper case then compare the user last name and patient last name. After that we make it pretty for the users to read.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2019 14:49:48 GMT</pubDate>
    <dc:creator>dougsummersett</dc:creator>
    <dc:date>2019-11-26T14:49:48Z</dc:date>
    <item>
      <title>How to adjust search to include names that are also hyphenated</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493403#M137625</link>
      <description>&lt;P&gt;We ingest patient records into Splunk and some compliance users need to search to see if an employee accessed records of family members. We create a report that shows any employee that accesses a record that exactly matches their last name. This will not match any patients that might be hyphenated or apostrophe. &lt;/P&gt;

&lt;P&gt;How can I adjust my search to make it not an exact match but if it contains the same value?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 18:30:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493403#M137625</guid>
      <dc:creator>dougsummersett</dc:creator>
      <dc:date>2019-11-25T18:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to adjust search to include names that are also hyphenated</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493404#M137626</link>
      <description>&lt;P&gt;Could you share your search as well a sample event or just the field containing the value you're searching for?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 18:56:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493404#M137626</guid>
      <dc:creator>oscar84x</dc:creator>
      <dc:date>2019-11-25T18:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to adjust search to include names that are also hyphenated</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493405#M137627</link>
      <description>&lt;P&gt;Here is the search we are using to match the user and patient's last names.&lt;/P&gt;

&lt;P&gt;index="clinical_applications" sourcetype=app | eval USER_NAME=split(USER_NAME,",") | eval USER_NAME_LAST=mvindex(USER_NAME,0) | eval USER_NAME_FIRST=mvindex(USER_NAME,1) | eval PATIENT_LAST_NAME=upper(PATIENT_LAST_NAME) | eval PATIENT_FIRST_NAME=upper(PATIENT_FIRST_NAME) | where PATIENT_LAST_NAME = USER_NAME_LAST | strcat PATIENT_FIRST_NAME " " PATIENT_LAST_NAME PATIENT_NAME | convert ctime(_time) as Time | rename EPIC_ENTERPRISE_MRN_ID as MRN_ID | rename METRIC_DESCRIPTION as ACTION | table Time,USER_NAME,WORKSTATION,PATIENT_NAME,MRN_ID,ENVIRONMENT,ACTION&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:08:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493405#M137627</guid>
      <dc:creator>dougsummersett</dc:creator>
      <dc:date>2020-09-30T03:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to adjust search to include names that are also hyphenated</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493406#M137628</link>
      <description>&lt;P&gt;In this search, we split the user_name field into first and last name then convert to upper case then compare the user last name and patient last name. After that we make it pretty for the users to read.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 14:49:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493406#M137628</guid>
      <dc:creator>dougsummersett</dc:creator>
      <dc:date>2019-11-26T14:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to adjust search to include names that are also hyphenated</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493407#M137629</link>
      <description>&lt;P&gt;Hi - I played around with a bunch of the options from here: &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/ConditionalFunctions#match.28SUBJECT.2C_.22REGEX.22.29"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/ConditionalFunctions#match.28SUBJECT.2C_.22REGEX.22.29&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And got the below code to work -&lt;/P&gt;

&lt;P&gt;{code}&lt;BR /&gt;
| makeresults count=1&lt;BR /&gt;
| streamstats count&lt;BR /&gt;
| eval Name2 = "Name2"&lt;BR /&gt;
| eval hyphenNameThatShouldMatch=case(count=1, "Name1-Name2")&lt;BR /&gt;
| eval hyphenNameThatShouldntMatch=case(count=1, "Name3-Name4")&lt;BR /&gt;
| eval match=case(like(hyphenNameThatShouldMatch,"%".Name2."%"), 1)&lt;BR /&gt;
| eval shouldntMatch=case(like(hyphenNameThatShouldntMatch,"%".Name2."%"), 1)&lt;BR /&gt;
| table Name2, hyphenNameThatShouldMatch, match, hyphenNameThatShouldntMatch, shouldntMatch&lt;BR /&gt;
{code}&lt;/P&gt;

&lt;P&gt;Basically, you asked Splunk to return a bool for whether there was a "like" regex match for the name with wildcards on each side, you can trim this if you know things like where the pattern should match more accurately. &lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 16:09:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493407#M137629</guid>
      <dc:creator>aberkow</dc:creator>
      <dc:date>2019-11-26T16:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to adjust search to include names that are also hyphenated</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493408#M137630</link>
      <description>&lt;P&gt;Here is a &lt;CODE&gt;run-anywhere&lt;/CODE&gt; search that proves that hyphenated searches do work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_* AND "data.instance_guid"="*-*-*-*-*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Are you saying that one of your datasets has stripped the &lt;CODE&gt;hyphens&lt;/CODE&gt; and &lt;CODE&gt;apostrophes&lt;/CODE&gt; from the dataset so you need to normalize one side or the other to do the search?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 00:34:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-adjust-search-to-include-names-that-are-also-hyphenated/m-p/493408#M137630</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-27T00:34:19Z</dc:date>
    </item>
  </channel>
</rss>

