<?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 what is the use of substr in my macro? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/what-is-the-use-of-substr-in-my-macro/m-p/315338#M94402</link>
    <description>&lt;P&gt;I have defined a field extraction in a macro as below &lt;/P&gt;

&lt;P&gt;my_search | eval field_A="EventCode: " + EventCode + "; EventType: " + EventType + "; Message: " + substr(Message,1,100)&lt;BR /&gt;
iseval = 0&lt;/P&gt;

&lt;P&gt;What is meant by that? could anyone explain please.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 17:02:17 GMT</pubDate>
    <dc:creator>pavanae</dc:creator>
    <dc:date>2020-09-29T17:02:17Z</dc:date>
    <item>
      <title>what is the use of substr in my macro?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/what-is-the-use-of-substr-in-my-macro/m-p/315338#M94402</link>
      <description>&lt;P&gt;I have defined a field extraction in a macro as below &lt;/P&gt;

&lt;P&gt;my_search | eval field_A="EventCode: " + EventCode + "; EventType: " + EventType + "; Message: " + substr(Message,1,100)&lt;BR /&gt;
iseval = 0&lt;/P&gt;

&lt;P&gt;What is meant by that? could anyone explain please.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:02:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/what-is-the-use-of-substr-in-my-macro/m-p/315338#M94402</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2020-09-29T17:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: what is the use of substr in my macro?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/what-is-the-use-of-substr-in-my-macro/m-p/315339#M94403</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;substr(X,Y,Z)   Returns a substring from X based on the starting position Y and the length Z.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the search above &lt;CODE&gt;substr&lt;/CODE&gt; returns the first 100 characters of the &lt;CODE&gt;Message&lt;/CODE&gt; field.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 02:13:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/what-is-the-use-of-substr-in-my-macro/m-p/315339#M94403</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-11-30T02:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: what is the use of substr in my macro?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/what-is-the-use-of-substr-in-my-macro/m-p/315340#M94404</link>
      <description>&lt;P&gt;The substr command grabs a section of text beginning at the first indicated index number Until the number of characters is reached (second number indicated). In your example, it is grabbing the first 100 characters of the field Message. &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/TextFunctions"&gt;http://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/TextFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 02:14:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/what-is-the-use-of-substr-in-my-macro/m-p/315340#M94404</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-11-30T02:14:55Z</dc:date>
    </item>
  </channel>
</rss>

