<?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: Find a field value string that is partially present in another field value string. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166798#M47470</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=bar
| eval matched=if(like(hostname,"%".username."%"),"True","False")
| table username hostname matched
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 18 Jun 2015 18:05:18 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2015-06-18T18:05:18Z</dc:date>
    <item>
      <title>Find a field value string that is partially present in another field value string.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166797#M47469</link>
      <description>&lt;P&gt;Hi Splunkers,&lt;BR /&gt;
I'm trying to work through a search where I have a base query delivering usernames and some corresponding hostnames. Hostnames are usually in the form of pc-username. There are frequently variants where the user will have pc-username-2 or pc-username-W7 etc. but typically 'username' is in there somewhere.&lt;BR /&gt;
What would be a way for me to locate instances where hostname contained the actual username and identify that instance as "True". OR instances where the hostname didn't contain the actual username and identify that instance as "False"?&lt;BR /&gt;
IE the first two results would be marked as true and the last one would be marked as false in the results below.&lt;/P&gt;

&lt;P&gt;index=foo sourcetype=bar | table username,hostname&lt;/P&gt;

&lt;P&gt;RequestorName   MachineName&lt;BR /&gt;
gtron   pc-gtron&lt;BR /&gt;
karthur pc-karthur-w8&lt;BR /&gt;
tkhan   pc-support-test&lt;/P&gt;

&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2015 17:21:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166797#M47469</guid>
      <dc:creator>lbogle</dc:creator>
      <dc:date>2015-06-18T17:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Find a field value string that is partially present in another field value string.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166798#M47470</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=bar
| eval matched=if(like(hostname,"%".username."%"),"True","False")
| table username hostname matched
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Jun 2015 18:05:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166798#M47470</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-06-18T18:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Find a field value string that is partially present in another field value string.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166799#M47471</link>
      <description>&lt;P&gt;Seriously, every time you pick up one of my questions, I get super excited because I know you almost always take the time to answer and answer correctly! Minus the extra parenthesis, that did it!&lt;BR /&gt;
You rock!&lt;BR /&gt;
Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2015 18:19:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166799#M47471</guid>
      <dc:creator>lbogle</dc:creator>
      <dc:date>2015-06-18T18:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Find a field value string that is partially present in another field value string.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166800#M47472</link>
      <description>&lt;P&gt;This makes me happy ;D Also, @lguinn is a rockstar!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2015 01:05:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166800#M47472</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2015-06-19T01:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Find a field value string that is partially present in another field value string.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166801#M47473</link>
      <description>&lt;P&gt;+1, upgoats for @lguinn! &lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2015 02:16:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166801#M47473</guid>
      <dc:creator>piebob</dc:creator>
      <dc:date>2015-06-19T02:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Find a field value string that is partially present in another field value string.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166802#M47474</link>
      <description>&lt;P&gt;Thanks, guys - and I fixed the typo...&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2015 17:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-a-field-value-string-that-is-partially-present-in-another/m-p/166802#M47474</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-06-19T17:36:59Z</dc:date>
    </item>
  </channel>
</rss>

