<?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 difference between fieldformat and eval operation time conversion? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252861#M75673</link>
    <description>&lt;P&gt;I am able to see that the following search returns the same result for fieldformat as well as eval time conversion operation. Is there any significant difference between these two in performance wise or in any others?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | head 1 | eval abc="1468308151" | fieldformat mytime=strftime(abc,"%H:%M") | eval mytime1=strftime(abc,"%H:%M") | table abc mytime mytime1

index=_internal | head 1 | eval abc="1468308151" | fieldformat mytime=strftime(abc,"%c") | eval mytime1=strftime(abc,"%c") | table abc mytime mytime1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here mytime and mytime1 fetch the same results.  as "12:51"&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jul 2016 07:33:10 GMT</pubDate>
    <dc:creator>splunkn</dc:creator>
    <dc:date>2016-07-12T07:33:10Z</dc:date>
    <item>
      <title>What is the difference between fieldformat and eval operation time conversion?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252861#M75673</link>
      <description>&lt;P&gt;I am able to see that the following search returns the same result for fieldformat as well as eval time conversion operation. Is there any significant difference between these two in performance wise or in any others?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | head 1 | eval abc="1468308151" | fieldformat mytime=strftime(abc,"%H:%M") | eval mytime1=strftime(abc,"%H:%M") | table abc mytime mytime1

index=_internal | head 1 | eval abc="1468308151" | fieldformat mytime=strftime(abc,"%c") | eval mytime1=strftime(abc,"%c") | table abc mytime mytime1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here mytime and mytime1 fetch the same results.  as "12:51"&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 07:33:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252861#M75673</guid>
      <dc:creator>splunkn</dc:creator>
      <dc:date>2016-07-12T07:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference between fieldformat and eval operation time conversion?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252862#M75674</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/Fieldformat"&gt;Fieldformat&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;With the fieldformat command you can&lt;BR /&gt;
use eval expressions to &lt;STRONG&gt;change the&lt;BR /&gt;
format of a field value when the&lt;BR /&gt;
results render. You can change the&lt;BR /&gt;
format without changing the underlying&lt;BR /&gt;
value of the field&lt;/STRONG&gt;.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&lt;STRONG&gt;Eval&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Eval will change the underlying value of the field.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 07:45:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252862#M75674</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-07-12T07:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference between fieldformat and eval operation time conversion?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252863#M75675</link>
      <description>&lt;P&gt;thanks javiergn..so coming to this scenario, formattting my epoch time here going to work same right? no better performance over one another?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 08:28:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252863#M75675</guid>
      <dc:creator>splunkn</dc:creator>
      <dc:date>2016-07-12T08:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference between fieldformat and eval operation time conversion?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252864#M75676</link>
      <description>&lt;P&gt;fieldformat is good for viewing purpose, when you want to do some calculations on the underlying field you need to use eval and work out. &lt;/P&gt;

&lt;P&gt;Basically &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;With FieldFormat you cant use the modified format to do calculations &lt;/LI&gt;
&lt;LI&gt;With eval you can use the modified values to do calculations &lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 12 Jul 2016 08:34:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252864#M75676</guid>
      <dc:creator>kishorksudha</dc:creator>
      <dc:date>2016-07-12T08:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference between fieldformat and eval operation time conversion?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252865#M75677</link>
      <description>&lt;P&gt;If there was any performance difference it would be tiny in any case but I couldn't say without running thorough tests.&lt;/P&gt;

&lt;P&gt;What you need to keep in mind is whether you want your field value to change or not. If you want to keep the value as it is but just display it differently (user-friendly for instance), then use fieldformat. Otherwise eval can do.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 08:42:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252865#M75677</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-07-12T08:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference between fieldformat and eval operation time conversion?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252866#M75678</link>
      <description>&lt;P&gt;Using &lt;CODE&gt;fieldformat&lt;/CODE&gt; creates an alias for a field leaving the original field value completely unchanged, whereas using &lt;CODE&gt;eval&lt;/CODE&gt; updates (completely destroys) the original field value and replaces it with a new value.  There should be no difference in performance in either case.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 12:34:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-fieldformat-and-eval-operation/m-p/252866#M75678</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-07-12T12:34:15Z</dc:date>
    </item>
  </channel>
</rss>

