<?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: Truncate the log description after n words. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676549#M113161</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I couldn't exactly understand what you're not doing with the timestamp. There are many different ways to extract the timestamp from the log. If you want to capture this field additionally, you can use \S+\s\S+.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is example regex;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;^\S+\s+\S+\s\w+\s(\S+(?:\S+\s+){1}\S+)&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2024 08:21:23 GMT</pubDate>
    <dc:creator>batabay</dc:creator>
    <dc:date>2024-02-05T08:21:23Z</dc:date>
    <item>
      <title>Truncate the log description after n words.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676539#M113156</link>
      <description>&lt;P&gt;How can i Truncate the log description after 20 words in splunk and store in new field.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 06:59:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676539#M113156</guid>
      <dc:creator>RSS_STT</dc:creator>
      <dc:date>2024-02-05T06:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Truncate the log description after n words.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676540#M113157</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;You can try this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test = "somestring1somestring2somestring3" 
| eval new_field = if(len(test)&amp;gt;20,substr(test,20,len(test)),null())&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Feb 2024 07:24:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676540#M113157</guid>
      <dc:creator>batabay</dc:creator>
      <dc:date>2024-02-05T07:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Truncate the log description after n words.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676542#M113158</link>
      <description>&lt;P&gt;i need to truncate the string based on word count, not based on character count.&lt;/P&gt;&lt;P&gt;it should save truncated string (start to 25 words) into new fields.&lt;/P&gt;&lt;P&gt;Current which you have provided doing on character count basis.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 07:40:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676542#M113158</guid>
      <dc:creator>RSS_STT</dc:creator>
      <dc:date>2024-02-05T07:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Truncate the log description after n words.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676543#M113159</link>
      <description>&lt;P&gt;Okay Than, We can use regex. Can you try this ?&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval description = "somestring1 somestring2 somestring3 somestring4 somestring5" 
| rex field=description "(?&amp;lt;new_field&amp;gt;^\S+(?:\S+\s+){20}\S+)" 
| eval new_field_replaced = replace(description,new_field,"")
| eval description = replace(description,new_field,"")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 07:51:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676543#M113159</guid>
      <dc:creator>batabay</dc:creator>
      <dc:date>2024-02-05T07:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Truncate the log description after n words.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676548#M113160</link>
      <description>&lt;P&gt;Looking good.&amp;nbsp; But this regex not handling the special character and digit. for example date 05/0/:2024 10:11:56.000 EST&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 08:12:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676548#M113160</guid>
      <dc:creator>RSS_STT</dc:creator>
      <dc:date>2024-02-05T08:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Truncate the log description after n words.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676549#M113161</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I couldn't exactly understand what you're not doing with the timestamp. There are many different ways to extract the timestamp from the log. If you want to capture this field additionally, you can use \S+\s\S+.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is example regex;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;^\S+\s+\S+\s\w+\s(\S+(?:\S+\s+){1}\S+)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 08:21:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Truncate-the-log-description-after-n-words/m-p/676549#M113161</guid>
      <dc:creator>batabay</dc:creator>
      <dc:date>2024-02-05T08:21:23Z</dc:date>
    </item>
  </channel>
</rss>

