<?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: Expanding data within my eval search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Expanding-data-within-my-eval-search/m-p/632028#M219533</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=data severity IN ("critical","high","medium","low")
| eval TopHost =
split([ search index=tenable severity IN ("critical","high","medium","low")
| where len(dnsName)&amp;gt;0
| dedup dnsName,solution
| dedup dnsName,pluginText
| rex field=pluginName "^(?&amp;lt;VulnName&amp;gt;(?:\w+\s+){2})"
| dedup dnsName,VulnName
| top limit=1 dnsName
| rename dnsName as query
| fields query
| head 5
| format "\"" "" "" "" "" "\""]," ")
| where dnsName=TopHost
| table dnsName, ip&lt;/LI-CODE&gt;&lt;P&gt;This assumes dnsName has no spaces in it&lt;/P&gt;</description>
    <pubDate>Thu, 23 Feb 2023 15:36:35 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-02-23T15:36:35Z</dc:date>
    <item>
      <title>Expanding data within my eval search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Expanding-data-within-my-eval-search/m-p/632022#M219529</link>
      <description>&lt;P&gt;index=data severity IN ("critical","high","medium","low")&lt;BR /&gt;| eval TopHost =&lt;BR /&gt;[ search index=tenable severity IN ("critical","high","medium","low")&lt;BR /&gt;| where len(dnsName)&amp;gt;0&lt;BR /&gt;| dedup dnsName,solution&lt;BR /&gt;| dedup dnsName,pluginText&lt;BR /&gt;| rex field=pluginName "^(?&amp;lt;VulnName&amp;gt;(?:\w+\s+){2})"&lt;BR /&gt;| dedup dnsName,VulnName&lt;BR /&gt;| top limit=1 dnsName&lt;BR /&gt;| rename dnsName as query&lt;BR /&gt;| fields query&lt;BR /&gt;| head 1]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;| where dnsName=TopHost&lt;BR /&gt;| table dnsName, ip&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My query above works, but missing one thing. Right now it is getting the first result ( using head command ). I am trying to do first 5 results and store that to my eval variable. I tried to change head 5 but got errors. Any help is appreciated.&amp;nbsp;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Attached error&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 15:06:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Expanding-data-within-my-eval-search/m-p/632022#M219529</guid>
      <dc:creator>AttarSingh1</dc:creator>
      <dc:date>2023-02-23T15:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding data within my eval search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Expanding-data-within-my-eval-search/m-p/632028#M219533</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=data severity IN ("critical","high","medium","low")
| eval TopHost =
split([ search index=tenable severity IN ("critical","high","medium","low")
| where len(dnsName)&amp;gt;0
| dedup dnsName,solution
| dedup dnsName,pluginText
| rex field=pluginName "^(?&amp;lt;VulnName&amp;gt;(?:\w+\s+){2})"
| dedup dnsName,VulnName
| top limit=1 dnsName
| rename dnsName as query
| fields query
| head 5
| format "\"" "" "" "" "" "\""]," ")
| where dnsName=TopHost
| table dnsName, ip&lt;/LI-CODE&gt;&lt;P&gt;This assumes dnsName has no spaces in it&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 15:36:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Expanding-data-within-my-eval-search/m-p/632028#M219533</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-02-23T15:36:35Z</dc:date>
    </item>
  </channel>
</rss>

