<?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: help correct eval command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667642#M229044</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249621"&gt;@olawalePS&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;the issue is probably related to the time format: you have different formats in yout data: 1,2 or 3 digits in milliseconds, probably your eval command correctly extracts data only when it matchjes the correct format.&lt;/P&gt;&lt;P&gt;You sould try to normalize your data, sometimes like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval 
   timestamp1=strptime(lastContactTime,"%Y-%m-%dT%H:%M:%S.%NZ"),
   timestamp2=strptime(lastContactTime,"%Y-%m-%dT%H:%M:%S.%2NZ"),   
   timestamp2=strptime(lastContactTime,"%Y-%m-%dT%H:%M:%S.%3NZ")
| eval timestamp=coalesce(timestamp1,timestamp2,timestamp3)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 07 Nov 2023 07:00:42 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-11-07T07:00:42Z</dc:date>
    <item>
      <title>help correct eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667561#M229014</link>
      <description>&lt;P&gt;Please help me correct the command below. It keeps returning all the devices as no even though the app is installed.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="jamf" sourcetype="jssUapiComputer:computerGeneral"
| dedup computer_meta.serial
| rename computerGeneral.lastContactTime AS lastContactTime
| eval timestamp = strptime(lastContactTime, "%Y-%m-%dT%H:%M:%S.%3QZ")
| eval sixtyDaysAgo = relative_time(now(), "-60d") 
| where timestamp&amp;gt;sixtyDaysAgo
| eval installed=if(computer_meta.serial IN [ search index="jamf" computer_meta.managed="true" sourcetype="jssUapiComputer:app" app.name="VMware CBCloud.app"| fields computer_meta.serial], "Yes", "No")
| table computer_meta.name, installed&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 06 Nov 2023 15:29:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667561#M229014</guid>
      <dc:creator>olawalePS</dc:creator>
      <dc:date>2023-11-06T15:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: help correct eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667564#M229017</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="jamf" sourcetype="jssUapiComputer:computerGeneral"
| dedup computer_meta.serial
| rename computerGeneral.lastContactTime AS lastContactTime
| eval timestamp = strptime(lastContactTime, "%Y-%m-%dT%H:%M:%S.%3QZ")
| eval sixtyDaysAgo = relative_time(now(), "-60d") 
| where timestamp&amp;gt;sixtyDaysAgo
| eval installed=if(computer_meta.serial IN ([ search index="jamf" computer_meta.managed="true" sourcetype="jssUapiComputer:app" app.name="VMware CBCloud.app"| stats count by computer_meta.serial
    | eval search="\"".'computer_meta.serial'."\""
    | stats values(search) as search
    | eval search = mvjoin(search,",")]), "Yes", "No")
| table computer_meta.name, installed&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 06 Nov 2023 15:44:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667564#M229017</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-11-06T15:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: help correct eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667565#M229018</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249621"&gt;@olawalePS&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;rename computer_meta.serial&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="jamf" sourcetype="jssUapiComputer:computerGeneral"
| dedup computer_meta.serial
| rename computerGeneral.lastContactTime AS lastContactTime computer_meta.serial AS computer_meta_serial
| eval timestamp = strptime(lastContactTime, "%Y-%m-%dT%H:%M:%S.%3QZ")
| eval sixtyDaysAgo = relative_time(now(), "-60d") 
| where timestamp&amp;gt;sixtyDaysAgo
| eval installed=if(computer_meta_serial IN [ search index="jamf" computer_meta.managed="true" sourcetype="jssUapiComputer:app" app.name="VMware CBCloud.app"| rename computer_meta.serial AS computer_meta_serial | fields computer_meta_serial], "Yes", "No")
| table computer_meta.name, installed&lt;/LI-CODE&gt;&lt;P&gt;or use single quotes (').&lt;/P&gt;&lt;P&gt;I prefer to rename fields, even if is longer.&lt;/P&gt;&lt;P&gt;ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 15:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667565#M229018</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-11-06T15:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: help correct eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667588#M229027</link>
      <description>&lt;P&gt;Renaming it did not change the results.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 16:59:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667588#M229027</guid>
      <dc:creator>olawalePS</dc:creator>
      <dc:date>2023-11-06T16:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: help correct eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667590#M229028</link>
      <description>&lt;P&gt;The results remained the same.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 17:00:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667590#M229028</guid>
      <dc:creator>olawalePS</dc:creator>
      <dc:date>2023-11-06T17:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: help correct eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667593#M229029</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249621"&gt;@olawalePS&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;are you sure about the time format?&lt;/P&gt;&lt;P&gt;could you share a sample of your logs?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 17:06:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667593#M229029</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-11-06T17:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: help correct eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667599#M229030</link>
      <description>&lt;P&gt;So I have attached to images&lt;BR /&gt;&lt;BR /&gt;Computers that have checked-in in less than 60 days (274)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2023-11-06 at 18.12.53.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27965i2C37B6CE9F13689A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-11-06 at 18.12.53.png" alt="Screenshot 2023-11-06 at 18.12.53.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;The subset of that that has CBC installed (270)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2023-11-06 at 18.15.18.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27967iC9A845A96220CBF9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-11-06 at 18.15.18.png" alt="Screenshot 2023-11-06 at 18.15.18.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want now is a query to identify the 4 devices that do not have the app installed&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 17:17:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667599#M229030</guid>
      <dc:creator>olawalePS</dc:creator>
      <dc:date>2023-11-06T17:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: help correct eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667642#M229044</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249621"&gt;@olawalePS&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;the issue is probably related to the time format: you have different formats in yout data: 1,2 or 3 digits in milliseconds, probably your eval command correctly extracts data only when it matchjes the correct format.&lt;/P&gt;&lt;P&gt;You sould try to normalize your data, sometimes like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval 
   timestamp1=strptime(lastContactTime,"%Y-%m-%dT%H:%M:%S.%NZ"),
   timestamp2=strptime(lastContactTime,"%Y-%m-%dT%H:%M:%S.%2NZ"),   
   timestamp2=strptime(lastContactTime,"%Y-%m-%dT%H:%M:%S.%3NZ")
| eval timestamp=coalesce(timestamp1,timestamp2,timestamp3)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 07:00:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-correct-eval-command/m-p/667642#M229044</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-11-07T07:00:42Z</dc:date>
    </item>
  </channel>
</rss>

