<?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: eval to handle 2 scenarios in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747399#M241815</link>
    <description>&lt;P&gt;Hi, Sai, sometimes i dont get the extra space so i have to cover 2 scenarios&lt;/P&gt;&lt;P&gt;will this only work when there is an extra space or it should take care of it when there is no extra space also&lt;/P&gt;&lt;P&gt;as we are specifying the extra space in the format and removing&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jun 2025 13:30:29 GMT</pubDate>
    <dc:creator>Raj_Splunk_Ing</dc:creator>
    <dc:date>2025-06-03T13:30:29Z</dc:date>
    <item>
      <title>eval to handle 2 scenarios</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747395#M241811</link>
      <description>&lt;P&gt;Hi, I have this field in this format and i am using eval to convert but sometimes there is an extra space in it&lt;/P&gt;&lt;P&gt;after :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mon 2 Jun 2025 20:51:24 : &lt;STRONG&gt;792&lt;/STRONG&gt; EDT&amp;nbsp; - with extra space after hhmmss (space before 792)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mon 2 Jun 2025 20:51:24 :&lt;STRONG&gt;792&lt;/STRONG&gt; EDT - this is another scenario where there will be no space&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;i have to get 2 scenarios in this eval - any help&lt;BR /&gt;| eval date_only=strftime(strptime(ClintReqRcvdTime, "%a %d %b %Y %H:%M:%S :&lt;STRONG&gt;%3N&lt;/STRONG&gt; %Z"), "%m/%d/%Y")&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 13:04:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747395#M241811</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-06-03T13:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: eval to handle 2 scenarios</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747397#M241813</link>
      <description>&lt;P&gt;tried trim(field) but it not help&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 13:17:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747397#M241813</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-06-03T13:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: eval to handle 2 scenarios</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747398#M241814</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/273058"&gt;@Raj_Splunk_Ing&lt;/a&gt;&amp;nbsp; try&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval date_only=strftime(strptime(replace(ClintReqRcvdTime, "\s+", " "), "%a %d %b %Y %H:%M:%S :%N EDT"), "%m/%d/%Y")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 Jun 2025 13:20:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747398#M241814</guid>
      <dc:creator>sainag_splunk</dc:creator>
      <dc:date>2025-06-03T13:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: eval to handle 2 scenarios</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747399#M241815</link>
      <description>&lt;P&gt;Hi, Sai, sometimes i dont get the extra space so i have to cover 2 scenarios&lt;/P&gt;&lt;P&gt;will this only work when there is an extra space or it should take care of it when there is no extra space also&lt;/P&gt;&lt;P&gt;as we are specifying the extra space in the format and removing&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 13:30:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747399#M241815</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-06-03T13:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: eval to handle 2 scenarios</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747401#M241816</link>
      <description>&lt;P&gt;Try using &lt;FONT face="courier new,courier"&gt;sed&lt;/FONT&gt; to normalize the data before conversion.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed field=ClintReqRcvdTime "s/: /:/"
| eval date_only=strftime(strptime(ClintReqRcvdTime, "%a %d %b %Y %H:%M:%S :%3N %Z"), "%m/%d/%Y")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 14:02:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747401#M241816</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2025-06-03T14:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: eval to handle 2 scenarios</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747402#M241817</link>
      <description>&lt;P&gt;hi Rich, is reg much better than replace.. in my case looks like replace is working&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 14:21:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747402#M241817</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-06-03T14:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: eval to handle 2 scenarios</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747403#M241818</link>
      <description>&lt;P&gt;Rich, this is working too; it will cover both scenarios right? when there is no extra space in it?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 14:41:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747403#M241818</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-06-03T14:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: eval to handle 2 scenarios</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747411#M241822</link>
      <description>&lt;P&gt;Yes, this covers both cases.&amp;nbsp; If the extra space is not present then &lt;FONT face="courier new,courier"&gt;sed&lt;/FONT&gt; does nothing.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 15:21:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-to-handle-2-scenarios/m-p/747411#M241822</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2025-06-03T15:21:29Z</dc:date>
    </item>
  </channel>
</rss>

