<?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 How to check for underscore in field values? in Splunk Cloud Platform</title>
    <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-check-for-underscore-in-field-values/m-p/669146#M2631</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am checking for underscore in field values and if it present then capture that value.&lt;/P&gt;&lt;P&gt;For Example: if name has underscore in it then value should get assigned to APP field and if it does not have underscore in it then value should get assigned to Host field&lt;/P&gt;&lt;P&gt;name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;APP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Host&lt;/P&gt;&lt;P&gt;ftr_score ftr-score&amp;nbsp; NA&lt;/P&gt;&lt;P&gt;terabyte&amp;nbsp; &amp;nbsp;NA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; terabyte&lt;BR /&gt;&lt;BR /&gt;I have tried using case and like statement but it does not work as expected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Nov 2023 07:44:27 GMT</pubDate>
    <dc:creator>Splunkerninja</dc:creator>
    <dc:date>2023-11-20T07:44:27Z</dc:date>
    <item>
      <title>How to check for underscore in field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-check-for-underscore-in-field-values/m-p/669146#M2631</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am checking for underscore in field values and if it present then capture that value.&lt;/P&gt;&lt;P&gt;For Example: if name has underscore in it then value should get assigned to APP field and if it does not have underscore in it then value should get assigned to Host field&lt;/P&gt;&lt;P&gt;name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;APP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Host&lt;/P&gt;&lt;P&gt;ftr_score ftr-score&amp;nbsp; NA&lt;/P&gt;&lt;P&gt;terabyte&amp;nbsp; &amp;nbsp;NA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; terabyte&lt;BR /&gt;&lt;BR /&gt;I have tried using case and like statement but it does not work as expected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 07:44:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-check-for-underscore-in-field-values/m-p/669146#M2631</guid>
      <dc:creator>Splunkerninja</dc:creator>
      <dc:date>2023-11-20T07:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to check for underscore in field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-check-for-underscore-in-field-values/m-p/669149#M2632</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/262258"&gt;@Splunkerninja&lt;/a&gt;&amp;nbsp;there are many way to achieve this, for example like below:&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval name="ft_name_1"&lt;BR /&gt;| eval underscorematch=if(match(name,".\_."),"Yes","No")&lt;BR /&gt;| eval name_value=if(underscorematch="Yes",name,"NA")&lt;BR /&gt;| table name underscorematch name_value&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 08:04:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-check-for-underscore-in-field-values/m-p/669149#M2632</guid>
      <dc:creator>bharathkumarnec</dc:creator>
      <dc:date>2023-11-20T08:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to check for underscore in field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-check-for-underscore-in-field-values/m-p/669154#M2633</link>
      <description>&lt;P&gt;Your example seems to change the underscore to a hyphen (I have assumed that this is a typo). Also, your criteria is not very precise, so I have assumed that you mean not an underscore, followed by an underscore, followed by not an underscore somewhere in the name.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval APP=if(match(name,"[^_]_[^_]"),name,null())
| eval Host=if(match(name,"[^_]_[^_]"),null(),name)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;You may need to adjust the match expression if the criteria I have&amp;nbsp; used is not what you meant.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 08:33:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-check-for-underscore-in-field-values/m-p/669154#M2633</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-11-20T08:33:58Z</dc:date>
    </item>
  </channel>
</rss>

