<?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: How to create eval statement to get percentage from 2 fields extracted with spath on JSON data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294305#M88867</link>
    <description>&lt;P&gt;@bwindham - Are you able to share any info on your KnowBe4 Splunk config?   Is there a prebuilt app from KnowBe4 or did you build the API input script yourself?&lt;/P&gt;

&lt;P&gt;Thank you for your time,&lt;BR /&gt;
Scott&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2020 21:26:54 GMT</pubDate>
    <dc:creator>s33butler</dc:creator>
    <dc:date>2020-01-21T21:26:54Z</dc:date>
    <item>
      <title>How to create eval statement to get percentage from 2 fields extracted with spath on JSON data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294300#M88862</link>
      <description>&lt;P&gt;I have a field PP that I would like to use in eval statement to get a percentage from JSON data and using spath.&lt;/P&gt;

&lt;P&gt;Here is the search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=knowbe4 | head 1 | spath input=_raw path="{}.name" output=Campaign | spath input=_raw path="{}.status" output=Status | spath input=_raw path="{}.started_at" output=Started | spath input=_raw path="{}.duration" output=Duration | spath input=_raw path="{}.scheduled_count" output=Recipients | spath input=_raw path="{}.delivered_count" output=Delivered | spath input=_raw path="{}.clicked_count" output=Clicked | spath input=_raw path="{}.attachment_open_count" output="AttachOpen" | spath input=_raw path="{}.reported_count" output=Reported | spath input=_raw path="{}.phish_prone_percentage" output=PP| convert num(PP) as PPP | eval perc=(PP * 100) |  table Campaign Status Started Duration Recipients Delivered Clicked "Attachment Open" Reported PP perc PPP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have values for PP and PPP but no value (null) for perc.&lt;/P&gt;

&lt;P&gt;Table results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Campaign  Status  Started   Duration  Recipients  Delivered  Clicked  AttachOpen  Reported   PP   perc   PPP
2018 W-2   Active   2/13/18     4             1657            1401           141           0                     140         .17              .17
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Feb 2018 18:05:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294300#M88862</guid>
      <dc:creator>bwindham</dc:creator>
      <dc:date>2018-02-14T18:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to create eval statement to get percentage from 2 fields extracted with spath on JSON data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294301#M88863</link>
      <description>&lt;P&gt;Try changing &lt;CODE&gt;| eval perc=(PP * 100)&lt;/CODE&gt; to &lt;CODE&gt;| eval perc=(PPP*100)&lt;/CODE&gt; in your query.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 21:23:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294301#M88863</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-02-14T21:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to create eval statement to get percentage from 2 fields extracted with spath on JSON data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294302#M88864</link>
      <description>&lt;P&gt;yep, typo on my part&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 03:23:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294302#M88864</guid>
      <dc:creator>bwindham</dc:creator>
      <dc:date>2018-02-17T03:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to create eval statement to get percentage from 2 fields extracted with spath on JSON data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294303#M88865</link>
      <description>&lt;P&gt;@bwindham, after correcting the fieldname if your issue is resolved, then kindly accept the answer to mark this question as answered!&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 10:07:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294303#M88865</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-02-18T10:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to create eval statement to get percentage from 2 fields extracted with spath on JSON data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294304#M88866</link>
      <description>&lt;P&gt;bwindham  - I'm curious on how you are getting your knowbe4 data into Splunk? &lt;/P&gt;

&lt;P&gt;We are new knowbe4 customers and wanted to know if its work ingesting the data into Splunk.&lt;/P&gt;

&lt;P&gt;thanks, &lt;/P&gt;

&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 21:54:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294304#M88866</guid>
      <dc:creator>dacosta123</dc:creator>
      <dc:date>2019-03-18T21:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to create eval statement to get percentage from 2 fields extracted with spath on JSON data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294305#M88867</link>
      <description>&lt;P&gt;@bwindham - Are you able to share any info on your KnowBe4 Splunk config?   Is there a prebuilt app from KnowBe4 or did you build the API input script yourself?&lt;/P&gt;

&lt;P&gt;Thank you for your time,&lt;BR /&gt;
Scott&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 21:26:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-eval-statement-to-get-percentage-from-2-fields/m-p/294305#M88867</guid>
      <dc:creator>s33butler</dc:creator>
      <dc:date>2020-01-21T21:26:54Z</dc:date>
    </item>
  </channel>
</rss>

