<?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 modify my search to add a column that sums CostPerDay field for each Feature field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350616#M103797</link>
    <description>&lt;P&gt;Hmm, close.  The columns look good but the math isn't executing the AnsysFeature*GACostPerDay to add amount to Total cost per session.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2017 19:02:53 GMT</pubDate>
    <dc:creator>gabarrygowin</dc:creator>
    <dc:date>2017-08-03T19:02:53Z</dc:date>
    <item>
      <title>How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350610#M103791</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;First thanks for the participation in this forum, many of your older solutions have helped greatly in my success in getting Splunk into our enterprise.  But I find myself stuck searching, trying, etc.&lt;/P&gt;

&lt;P&gt;We have an existing search to show how many engineering licenses are checked out past 24 hours and display as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=unix host=torlicvlp02* source=/var/log/messages sourcetype=syslog process=AUDIT_ANSYS_USER_LICENSE | stats count by Username,AnsysFeature,AnsysDays | sort-AnsysDays 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The challenge is that we need to add a column "Cost Per Day" using the cost of the 'Feature' from the lookup we've uploaded.  The lookup is called ANSYSCOST.csv and is formatted:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;PRODUCT FEATURE SplunkFeatureName    GACostPerDay 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can someone help me get the search working to add a column that sums Cost Per Day for each Feature checked out?&lt;/P&gt;

&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 16:45:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350610#M103791</guid>
      <dc:creator>gabarrygowin</dc:creator>
      <dc:date>2017-08-03T16:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350611#M103792</link>
      <description>&lt;P&gt;This should get you started.  If the same feature might be present in more than one product then you'll need a product field to narrow the lookup.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=unix host=torlicvlp02* source=/var/log/messages sourcetype=syslog process=AUDIT_ANSYS_USER_LICENSE | stats count by Username,AnsysFeature,AnsysDays | sort-AnsysDays | lookup ANSYSCOST.csv FEATURE as AnsysFeature OUTPUT GACostPerDay | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Aug 2017 17:31:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350611#M103792</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-03T17:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350612#M103793</link>
      <description>&lt;P&gt;index=unix host=torlicvlp02* source=/var/log/messages sourcetype=syslog process=AUDIT_ANSYS_USER_LICENSE | lookup ANSYSCOST.csv  FEATURE as AnsysFeature OUTPUTNEW PRODUCT as Product, SplunkFeatureName  GACostPerDay | stats count by Username,AnsysFeature,AnsysDays  GACostPerDay | rename GACostPerDay  as "Cost Per Day" | sort-AnsysDays&lt;/P&gt;

&lt;P&gt;Note: Need to use common field from lookup and events before "OUTPUTNEW" keyword&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:13:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350612#M103793</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2020-09-29T15:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350613#M103794</link>
      <description>&lt;P&gt;You guys rock!&lt;/P&gt;

&lt;P&gt;I just realized I didn't pose a perfect question here.  I also need to compute (eval?) the AnsysDays x Cost Per Day and provide a Total cost per session to Date.&lt;/P&gt;

&lt;P&gt;Thanks for the progress, can't tell you how much this has helped.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 17:48:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350613#M103794</guid>
      <dc:creator>gabarrygowin</dc:creator>
      <dc:date>2017-08-03T17:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350614#M103795</link>
      <description>&lt;P&gt;index=unix host=torlicvlp02* source=/var/log/messages sourcetype=syslog process=AUDIT_ANSYS_USER_LICENSE | eval totalCost = AnsysDays * GACostPerDay  |bucket span=1d _time | stats sum(totalCost) as  "Total cost per session" by Username,AnsysFeature &lt;/P&gt;

&lt;P&gt;I hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:13:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350614#M103795</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2020-09-29T15:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350615#M103796</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=unix host=torlicvlp02* source=/var/log/messages sourcetype=syslog process=AUDIT_ANSYS_USER_LICENSE
| bin _time span=1d
| stats count BY _time Username AnsysFeature AnsysDays
| lookup ANSYSCOST.csv FEATURE as AnsysFeature OUTPUT GACostPerDay
| stats sum(count) AS count sum(GACostPerDay) AS TotalCost BY Username AnsysFeature AnsysDays
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Aug 2017 18:49:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350615#M103796</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-08-03T18:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350616#M103797</link>
      <description>&lt;P&gt;Hmm, close.  The columns look good but the math isn't executing the AnsysFeature*GACostPerDay to add amount to Total cost per session.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 19:02:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350616#M103797</guid>
      <dc:creator>gabarrygowin</dc:creator>
      <dc:date>2017-08-03T19:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350617#M103798</link>
      <description>&lt;P&gt;can you post a sample event&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 19:15:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350617#M103798</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2017-08-03T19:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350618#M103799</link>
      <description>&lt;P&gt;Aug  3 03:50:03 torlicvlp02 AUDIT_ANSYS_USER_LICENSE: usera has been using feature ansys since: 1 days 16 hours 59 minutes 03 seconds on the hosts: XXXX.ga.com&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:13:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350618#M103799</guid>
      <dc:creator>gabarrygowin</dc:creator>
      <dc:date>2020-09-29T15:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350619#M103800</link>
      <description>&lt;P&gt;So, I'm thinking the 'days' and $ wording in AnsysDays and GACostPerDay are tripping up the eval.  Taking them out so that I only have digits.  Will take a few before the new csv is seen.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 19:47:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350619#M103800</guid>
      <dc:creator>gabarrygowin</dc:creator>
      <dc:date>2017-08-03T19:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350620#M103801</link>
      <description>&lt;P&gt;Well, it's not pretty but it works!!!!  Taking your helpful inputs I got the following to work:&lt;/P&gt;

&lt;P&gt;index=unix host=torlicvlp02* source=/var/log/messages sourcetype=syslog process=AUDIT_ANSYS_USER_LICENSE | lookup ansyscost.csv FEATURE as AnsysFeature OUTPUTNEW PRODUCT as Product, SplunkFeatureName GACostPerDay | stats count by Username,AnsysFeature,AnsysDay,GACostPerDay | eval Session Cost=AnsysDay*GACostPerDay | rename GACostPerDay as "Cost Per Day" | rename Username as User | rename AnsysFeature as "ANSYS Item" | rename AnsysDay as "Days Checked Out" | sort-"Days Checked Out" | fields - count&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350620#M103801</guid>
      <dc:creator>gabarrygowin</dc:creator>
      <dc:date>2020-09-29T15:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350621#M103802</link>
      <description>&lt;P&gt;index=unix host=torlicvlp02* source=/var/log/messages sourcetype=syslog process=AUDIT_ANSYS_USER_LICENSE | lookup ansyscost.csv FEATURE as AnsysFeature OUTPUTNEW PRODUCT as Product, SplunkFeatureName GACostPerDay | stats count by Username,AnsysFeature,AnsysDay,GACostPerDay | eval Session Cost=AnsysDay*GACostPerDay | rename GACostPerDay as "Cost Per Day"  | rename GACostPerDay as "Cost Per Day", Username as User, AnsysFeature as "ANSYS Item",AnsysDay as "Days Checked Out" | sort - "Days Checked Out" | fields - count&lt;/P&gt;

&lt;P&gt;it enough to use single rename command&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:14:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350621#M103802</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2020-09-29T15:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to add a column that sums CostPerDay field for each Feature field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350622#M103803</link>
      <description>&lt;P&gt;You're absolutely correct and thanks, was eating the elephant bite by bite.  &lt;/P&gt;

&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 21:04:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-add-a-column-that-sums-CostPerDay/m-p/350622#M103803</guid>
      <dc:creator>gabarrygowin</dc:creator>
      <dc:date>2017-08-03T21:04:52Z</dc:date>
    </item>
  </channel>
</rss>

