<?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 merge fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291884#M88157</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm new to the splunk universe, and I need to create a dashboard listing the CVEs (security holes) of a Docker image.&lt;/P&gt;

&lt;P&gt;I think my need is feasible via splunk, but I don't know how to proceed.  I'll try to go into as much detail as I can.&lt;/P&gt;

&lt;P&gt;First of all, I get all these informations for scanning an image in splunk (example: debian)&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/233586-capture1.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;I would like to process this information to get a dashboard similar to this one:&lt;BR /&gt;
&lt;A href="https://anchore.io/image/dockerhub/2b98c9851a37e18356abe407922726dc35c370f7cee76f435f94ee92950b4493?repo=library%2Fdebian&amp;amp;tag=latest#security" target="_blank"&gt;https://anchore.io/image/dockerhub/2b98c9851a37e18356abe407922726dc35c370f7cee76f435f94ee92950b4493?repo=library%2Fdebian&amp;amp;tag=latest#security&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;First, I would like to list all CVE line by line as on the website above. But when I try to do that, I get that result:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/233587-capture2.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;I have a column scrolling around the field with its number, and all this information is on one line. I would like all vulnerabilities_*_vuln fields to be "merged" into a single CVE field, in order to have the same result as on the anchore.io site above&lt;/P&gt;

&lt;P&gt;Is it possible via splunk to get this result?&lt;/P&gt;

&lt;P&gt;Thank you in advance, &lt;/P&gt;

&lt;P&gt;Sincerely.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 18:42:16 GMT</pubDate>
    <dc:creator>skhedim</dc:creator>
    <dc:date>2020-09-29T18:42:16Z</dc:date>
    <item>
      <title>merge fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291884#M88157</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm new to the splunk universe, and I need to create a dashboard listing the CVEs (security holes) of a Docker image.&lt;/P&gt;

&lt;P&gt;I think my need is feasible via splunk, but I don't know how to proceed.  I'll try to go into as much detail as I can.&lt;/P&gt;

&lt;P&gt;First of all, I get all these informations for scanning an image in splunk (example: debian)&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/233586-capture1.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;I would like to process this information to get a dashboard similar to this one:&lt;BR /&gt;
&lt;A href="https://anchore.io/image/dockerhub/2b98c9851a37e18356abe407922726dc35c370f7cee76f435f94ee92950b4493?repo=library%2Fdebian&amp;amp;tag=latest#security" target="_blank"&gt;https://anchore.io/image/dockerhub/2b98c9851a37e18356abe407922726dc35c370f7cee76f435f94ee92950b4493?repo=library%2Fdebian&amp;amp;tag=latest#security&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;First, I would like to list all CVE line by line as on the website above. But when I try to do that, I get that result:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/233587-capture2.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;I have a column scrolling around the field with its number, and all this information is on one line. I would like all vulnerabilities_*_vuln fields to be "merged" into a single CVE field, in order to have the same result as on the anchore.io site above&lt;/P&gt;

&lt;P&gt;Is it possible via splunk to get this result?&lt;/P&gt;

&lt;P&gt;Thank you in advance, &lt;/P&gt;

&lt;P&gt;Sincerely.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:42:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291884#M88157</guid>
      <dc:creator>skhedim</dc:creator>
      <dc:date>2020-09-29T18:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: merge fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291885#M88158</link>
      <description>&lt;P&gt;You might want to eval, coalesce. I don't know if this will work..Just spitballing here.  You'll have to fill in the additional fields in the eval statements if this works.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="poc_anchor" "imagetag=docker.io/debian:latest
| eval "vulnerabilities"=coalesce(vulnerabilities_0_vuln,vulnerabilities_10_vuln,vulnerabilities_11_vuln)
| eval "severity"=coalesce(vulnerabilities_0_severity,vulnerabilities_10_severity,vulnerabilities_11_severity)
|stats list(vulnerabilities) as vulnerabilities by severity
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Another option would be to create a more generic field extraction with a single name that captures all the CVE-\d+-\d+-\d+- patterns. &lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 17:38:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291885#M88158</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2018-03-27T17:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: merge fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291886#M88159</link>
      <description>&lt;P&gt;Okay so you need to extract the vulnerabilities_*_vuln in one field . and then expand it .&lt;BR /&gt;
can you share one sample event? &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:43:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291886#M88159</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2020-09-29T18:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: merge fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291887#M88160</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="poc_anchor" "imagetag=docker.io/debian:latest
| fields index vulnerabilities_*
| untable index attribute value
| rex field=attribute "vulnerability_(?&amp;lt;VulnID&amp;gt;\d+)_(?&amp;lt;name&amp;gt;\w+)"
| chart values(value) over VulnID over name
| table vuln severity package fix url
| rename vuln as "CVE ID" severity as "Severity" package as "Vulnerable Package" fix as "Fix Available" url as "URL"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Mar 2018 22:38:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291887#M88160</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-03-27T22:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: merge fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291888#M88161</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;thanks for your quick answers!&lt;/P&gt;

&lt;P&gt;I'm going to clarify what I want to reproduce, I want to get this table with the same columns based on the fields vulnerabilities_x_fix, vulnerabilities_x_vuln, etc.. I want to list every _vuln vulnerability on one line and the same with _fix, etc.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/235575-capture.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;I think somesoni2's answer is very close to what I want. But I get an error Error in'chart' command: Invalid argument:'over'. if I replace the second over with "by" I have no more error but no result is displayed.&lt;/P&gt;

&lt;P&gt;I also tried the JDukeSplunk solution, I get a table, but with only one line.&lt;/P&gt;

&lt;P&gt;Do you have any other ideas? Thank you again.&lt;/P&gt;

&lt;P&gt;Sincerely.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:48:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291888#M88161</guid>
      <dc:creator>skhedim</dc:creator>
      <dc:date>2020-09-29T18:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: merge fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291889#M88162</link>
      <description>&lt;P&gt;thanks for the answer, I think it's very close to what I want, though it doesn't return anything. I don't understand the untable line. once I launched the untable line I couldn't do anything in return. Do you know what the problem might be?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 09:11:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291889#M88162</guid>
      <dc:creator>skhedim</dc:creator>
      <dc:date>2018-03-28T09:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: merge fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291890#M88163</link>
      <description>&lt;P&gt;What all fields do you get when younrun below query?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="poc_anchor" "imagetag=docker.io/debian:latest
 | table index vulnerabilities_*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After adding `| unstable index attribute value´ to above you should get a table with 3 columns index attribute value&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 11:15:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291890#M88163</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-03-28T11:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: merge fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291891#M88164</link>
      <description>&lt;P&gt;It's working!&lt;/P&gt;

&lt;P&gt;I hadn't seen it but it was just missing "ies" at the end of vulnerabilities here:&lt;/P&gt;

&lt;P&gt;rex field=attribute "vulnerabilit*&lt;EM&gt;ies&lt;/EM&gt;*&lt;EM&gt;(?\d+)&lt;/EM&gt;(?\w+)"&lt;/P&gt;

&lt;P&gt;That's exactly what I wanted, thanks again!&lt;/P&gt;

&lt;P&gt;See you later&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:47:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-fields/m-p/291891#M88164</guid>
      <dc:creator>skhedim</dc:creator>
      <dc:date>2020-09-29T18:47:53Z</dc:date>
    </item>
  </channel>
</rss>

