<?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: way to use case insensitive fields - Not Value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/way-to-use-case-insensitive-fields-Not-Value/m-p/530909#M149969</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229149"&gt;@Shariq&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a number of ways to resolve this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Fix the data &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. Set up a new calculated field which will create your preferred field name based on the others, for example like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval customerNumber=coalesce(customerNumber, CUSTOMERNUMBER, CusomerNumber, customernumber, customerNo)
| eval isoCountryCode=coalesce(isoCountryCode, isocountrycode, ISOCountryCode)&lt;/LI-CODE&gt;&lt;P&gt;In the calculated field definition, you just use the coalesce() part and put in all the field variants you want to normalise to the preferred field name.&lt;/P&gt;&lt;P&gt;Set up one calculated field for each of the fields you want to normalise.&lt;/P&gt;&lt;P&gt;Then in your search you will only need to do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test sourcetype="testsamples" testapi "ProxyRequestFlowName = testDetails-OpenAPIv3GetVerb" isoCountryCode=US &lt;/LI-CODE&gt;&lt;P&gt;You can read about&amp;nbsp;the coalesce function here&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.0/SearchReference/ConditionalFunctions#coalesce.28X.2C....29" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.0/SearchReference/ConditionalFunctions#coalesce.28X.2C....29&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There are other ways to do this, but this is probably the simplest and most typical way to solve this problem. If you come across a new variant then you can always add it to the coalesce list.&lt;/P&gt;&lt;P&gt;Setting up aliases is another way to do this, but it's not so simple to manage multiple aliases to the same base name.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 22:29:50 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2020-11-25T22:29:50Z</dc:date>
    <item>
      <title>way to use case insensitive fields - Not Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/way-to-use-case-insensitive-fields-Not-Value/m-p/530904#M149966</link>
      <description>&lt;P&gt;&lt;SPAN class="t"&gt;Mydata is like below where the customerNumber can come like CustomerNumber or customernumber or CUSTOMERNUMBER&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;AND isoCountryCode can come as IsoCountryCode, ISOCountryCode or any other combination.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now during field extraction Splunk considers all these fields as seperate. though while writing query i want to consider all these fields as one.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Environment&lt;/SPAN&gt; &lt;SPAN class="t"&gt;=&lt;/SPAN&gt; &lt;SPAN class="t"&gt;prod-dmz-usch01&lt;/SPAN&gt; | &lt;SPAN class="t"&gt;API&lt;/SPAN&gt; &lt;SPAN class="t"&gt;=&lt;/SPAN&gt; &lt;SPAN class="t a"&gt;&lt;SPAN class="t"&gt;testapi&lt;/SPAN&gt;&lt;/SPAN&gt;| &lt;SPAN class="t"&gt;RequestURI&lt;/SPAN&gt; &lt;SPAN class="t"&gt;=&lt;/SPAN&gt; &lt;SPAN class="t"&gt;/test/v5/tesdt/10-12345&lt;/SPAN&gt;?&lt;SPAN class="t"&gt;customerNumber=01-12345&lt;/SPAN&gt;&amp;amp;&lt;SPAN class="t"&gt;isoCountryCode=US&lt;/SPAN&gt; | &lt;SPAN class="t a"&gt;&lt;SPAN class="t"&gt;ProxyRequestFlowName&lt;/SPAN&gt; &lt;SPAN class="t"&gt;=&lt;/SPAN&gt; &lt;SPAN class="t"&gt;testDetails-OpenAPIv3GetVerb.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t a"&gt;&lt;SPAN class="t"&gt;My query is as below:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t a"&gt;&lt;SPAN class="t"&gt;index=test sourcetype="testsamples" testapi "ProxyRequestFlowName = testDetails-OpenAPIv3GetVerb"&lt;BR /&gt;| search isocountrycode=US OR isoCountryCode=US&amp;nbsp;&amp;nbsp; -- this seems to be taking care of multiple values but it is not a good idea to write each field here, how to handle all scenario's ?&lt;BR /&gt;| bucket _time span="24h"&lt;BR /&gt;| chart count by customerNumber where count in top100 -- i am able to give only one value of customer number here , how can i handle all use cases ?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 21:59:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/way-to-use-case-insensitive-fields-Not-Value/m-p/530904#M149966</guid>
      <dc:creator>Shariq</dc:creator>
      <dc:date>2020-11-25T21:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: way to use case insensitive fields - Not Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/way-to-use-case-insensitive-fields-Not-Value/m-p/530909#M149969</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229149"&gt;@Shariq&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a number of ways to resolve this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Fix the data &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. Set up a new calculated field which will create your preferred field name based on the others, for example like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval customerNumber=coalesce(customerNumber, CUSTOMERNUMBER, CusomerNumber, customernumber, customerNo)
| eval isoCountryCode=coalesce(isoCountryCode, isocountrycode, ISOCountryCode)&lt;/LI-CODE&gt;&lt;P&gt;In the calculated field definition, you just use the coalesce() part and put in all the field variants you want to normalise to the preferred field name.&lt;/P&gt;&lt;P&gt;Set up one calculated field for each of the fields you want to normalise.&lt;/P&gt;&lt;P&gt;Then in your search you will only need to do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test sourcetype="testsamples" testapi "ProxyRequestFlowName = testDetails-OpenAPIv3GetVerb" isoCountryCode=US &lt;/LI-CODE&gt;&lt;P&gt;You can read about&amp;nbsp;the coalesce function here&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.0/SearchReference/ConditionalFunctions#coalesce.28X.2C....29" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.0/SearchReference/ConditionalFunctions#coalesce.28X.2C....29&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There are other ways to do this, but this is probably the simplest and most typical way to solve this problem. If you come across a new variant then you can always add it to the coalesce list.&lt;/P&gt;&lt;P&gt;Setting up aliases is another way to do this, but it's not so simple to manage multiple aliases to the same base name.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 22:29:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/way-to-use-case-insensitive-fields-Not-Value/m-p/530909#M149969</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-11-25T22:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: way to use case insensitive fields - Not Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/way-to-use-case-insensitive-fields-Not-Value/m-p/530922#M149973</link>
      <description>&lt;P&gt;eval coalesce worked well for me without changing the data at ingestion. thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 00:16:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/way-to-use-case-insensitive-fields-Not-Value/m-p/530922#M149973</guid>
      <dc:creator>Shariq</dc:creator>
      <dc:date>2020-11-26T00:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: way to use case insensitive fields - Not Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/way-to-use-case-insensitive-fields-Not-Value/m-p/530928#M149977</link>
      <description>&lt;P&gt;yeah, exactly, .. the&amp;nbsp;&lt;SPAN&gt;coalesce is a simple, superb command, many of the new Splunkers(including me ;)) are not aware of.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Splunk guys should include these basic commands into the Splunk Fundamentals 1/2 training!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;tagging some splunk employees...&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/202391"&gt;@esix_splunk&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/45"&gt;@gkanapathy&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1357"&gt;@yannK&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1386"&gt;@jbsplunk&lt;/a&gt;&amp;nbsp;, thanks.!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 01:31:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/way-to-use-case-insensitive-fields-Not-Value/m-p/530928#M149977</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-11-26T01:31:44Z</dc:date>
    </item>
  </channel>
</rss>

