<?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 find the length of the string using len(string) function in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-length-of-the-string-using-len-string-function/m-p/30278#M178005</link>
    <description>&lt;P&gt;Fields are case-sensitive, search is not.  Try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"corid=" | eval length=len(corid) | fillnull value=0 length | fields + length
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 19 Apr 2012 03:38:44 GMT</pubDate>
    <dc:creator>araitz</dc:creator>
    <dc:date>2012-04-19T03:38:44Z</dc:date>
    <item>
      <title>How to find the length of the string using len(string) function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-length-of-the-string-using-len-string-function/m-p/30277#M178004</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to extract a corId from the log and find the length of the corId.&lt;BR /&gt;
when searching am able to successfully locate the Cor Id however when evaluating its lengths, I am not able to succeed.&lt;BR /&gt;
I used the search query as below&lt;/P&gt;

&lt;P&gt;corId | eval length=len(corId)&lt;/P&gt;

&lt;P&gt;the actual log file is as below:&lt;BR /&gt;
ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)'&amp;gt; &amp;lt;&lt;ANONYMOUS&gt;&amp;gt; &amp;lt;&amp;gt; &amp;lt;&amp;gt; &amp;lt;1334795010998&amp;gt; &lt;BEA-000000&gt; &amp;lt; [RouteNodeAccountContactdetails, null, null, REQUEST] Header in request node of  getAccountContactDetails Service: &lt;HEADER S="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;BR /&gt;
  &lt;WSCORIDSOAPHEADER corid="C7FB61810A75D70801C64ED865FB85DA,1:2:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:7:336,0,0,au11qsn01atels2|WebLogic|wl_mp_ep_0101|WebServices|Client|http_//telstra.com/ep/service/user/2009/1|getAccountContactDetails,2,AgAAALJIQgAAAAFGAAAAAQAAABFqYXZhLnV0aWwuSGFzaE1hcAAAAAJIQgAAAAJGAAAAAgAAABBqYXZhLmxhbmcuU3RyaW5nAA9DYWxsZXJUaW1lc3RhbXBIQgAAAANFAAAAAgANMTMzNDc5NTAxMDgyNEhCAAAABEUAAAACAApUeG5UcmFjZUlkSEIAAAAFRQAAAAIAIEM3RkI2Qzk0MEE3NUQ3MDgwMUM2NEVEOEI3Q0JBNEZC" xmlns="http://www.wilytech.com/"&gt;&lt;/WSCORIDSOAPHEADER&gt;&lt;BR /&gt;
  &lt;MESSAGEID WSA="http://schemas.xmlsoap.org/ws/2004/08/addressing"&gt;123&lt;A href="https://answers.splunk.comwsa:MessageID"&gt;/wsa:MessageID&lt;/A&gt;&lt;BR /&gt;
  &lt;FROM WSA="http://schemas.xmlsoap.org/ws/2004/08/addressing"&gt;&lt;BR /&gt;
    &lt;ADDRESS&gt;portal&lt;/ADDRESS&gt;&lt;BR /&gt;
    &lt;REFERENCEPARAMETERS&gt;&lt;BR /&gt;
      &lt;WEBHOSTIPADDRESS&gt;10.117.215.8&lt;/WEBHOSTIPADDRESS&gt;&lt;BR /&gt;
      &lt;SESSIONID&gt;123&lt;/SESSIONID&gt;&lt;BR /&gt;
    &lt;/REFERENCEPARAMETERS&gt;&lt;BR /&gt;
  &lt;A href="https://answers.splunk.comwsa:From"&gt;/wsa:From&lt;/A&gt;&lt;BR /&gt;
  &lt;USERID&gt;E8813354426S36&lt;/USERID&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.comS:Header"&gt;/S:Header&lt;/A&gt;&amp;gt; &lt;/FROM&gt;&lt;/MESSAGEID&gt;&lt;/HEADER&gt;&lt;/BEA-000000&gt;&lt;/ANONYMOUS&gt;&lt;/P&gt;

&lt;H4&gt;&amp;lt;19/04/2012 10:23:25 AM EST&amp;gt; &lt;ERROR&gt; &lt;ALSB logging=""&gt; &lt;AU11QAPBQ0TELS2&gt; &lt;WL_MP_OSB_0102&gt; &amp;lt;[ACTIVE] ExecuteThread: '30' for queue: 'weblogic.kernel.Default (self-tuning)'&amp;gt; &amp;lt;&lt;ANONYMOUS&gt;&amp;gt; &amp;lt;&amp;gt; &amp;lt;&amp;gt; &amp;lt;1334795005278&amp;gt; &lt;BEA-000000&gt; &amp;lt; [RouteNodeUserDetails, null, null, REQUEST] Header in request node of getUsersDetails Service: &lt;HEADER S="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;/HEADER&gt;&lt;/BEA-000000&gt;&lt;/ANONYMOUS&gt;&lt;/WL_MP_OSB_0102&gt;&lt;/AU11QAPBQ0TELS2&gt;&lt;/ALSB&gt;&lt;/ERROR&gt;&lt;/H4&gt;

&lt;P&gt;&lt;WSCORIDSOAPHEADER corid="C7FB6C980A75D70801C64ED861D0D6F5,1:1,0,0,au11qsn01atels2|WebLogic|wl_mp_ep_0101|WebServices|Client|http_//telstra.com/ep/service/user/2009/1|getUserDetails,2,AgAAALJIQgAAAAFGAAAAAQAAABFqYXZhLnV0aWwuSGFzaE1hcAAAAAJIQgAAAAJGAAAAAgAAABBqYXZhLmxhbmcuU3RyaW5nAA9DYWxsZXJUaW1lc3RhbXBIQgAAAANFAAAAAgANMTMzNDc5NTAwNTA4N0hCAAAABEUAAAACAApUeG5UcmFjZUlkSEIAAAAFRQAAAAIAIEM3RkI2OUUwMEE3NUQ3MDgwMUM2NEVEODlCQjBGRUYy" xmlns="http://www.wilytech.com/"&gt;&lt;/WSCORIDSOAPHEADER&gt;&lt;BR /&gt;
  &lt;MESSAGEID WSA="http://schemas.xmlsoap.org/ws/2004/08/addressing"&gt;123&lt;A href="https://answers.splunk.comwsa:MessageID"&gt;/wsa:MessageID&lt;/A&gt;&lt;BR /&gt;
  &lt;FROM WSA="http://schemas.xmlsoap.org/ws/2004/08/addressing"&gt;&lt;/FROM&gt;&lt;/MESSAGEID&gt;&lt;/P&gt;

&lt;P&gt;please help.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2012 02:49:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-length-of-the-string-using-len-string-function/m-p/30277#M178004</guid>
      <dc:creator>splunk_jerome</dc:creator>
      <dc:date>2012-04-19T02:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the length of the string using len(string) function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-length-of-the-string-using-len-string-function/m-p/30278#M178005</link>
      <description>&lt;P&gt;Fields are case-sensitive, search is not.  Try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"corid=" | eval length=len(corid) | fillnull value=0 length | fields + length
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Apr 2012 03:38:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-length-of-the-string-using-len-string-function/m-p/30278#M178005</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-04-19T03:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the length of the string using len(string) function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-length-of-the-string-using-len-string-function/m-p/30279#M178006</link>
      <description>&lt;P&gt;Have you extracted the corId field yet with a field extraction? &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.1/Knowledge/Addfieldsatsearchtime"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.1/Knowledge/Addfieldsatsearchtime&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Once you have the field extracted, eval with the len function is probably the way to go.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;From there you can explore doing simple stats around this field... &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;corId | eval length=len(corId) | stats count by length&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;corId | eval length=len(corId) | stats max(length) min(length) by User&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Or finding searches with especially long ones..&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;* | eval length=len(corId) | where length&amp;gt;40&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2012 03:42:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-length-of-the-string-using-len-string-function/m-p/30279#M178006</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2012-04-19T03:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the length of the string using len(string) function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-length-of-the-string-using-len-string-function/m-p/30280#M178007</link>
      <description>&lt;P&gt;&lt;CODE&gt;* | eval length=len(corId) | where length&amp;gt;40&lt;/CODE&gt; - perfect thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 16:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-length-of-the-string-using-len-string-function/m-p/30280#M178007</guid>
      <dc:creator>jakeblack</dc:creator>
      <dc:date>2016-03-07T16:36:33Z</dc:date>
    </item>
  </channel>
</rss>

