<?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 can I create the same fields with different values within the same event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/329000#M166124</link>
    <description>&lt;P&gt;Log is look like :&lt;/P&gt;

&lt;P&gt;......&lt;BR /&gt;
cveid="1234"&lt;BR /&gt;
cvss= "abcd"&lt;BR /&gt;
.........&lt;BR /&gt;
cveid="34"&lt;BR /&gt;
cvss= "abdfd"&lt;BR /&gt;
.........&lt;BR /&gt;
cveid="153534"&lt;BR /&gt;
cvss= "abgdd"&lt;BR /&gt;
.........&lt;BR /&gt;
cveid="122344"&lt;BR /&gt;
cvss= "adfscd"&lt;/P&gt;

&lt;P&gt;and so on&lt;/P&gt;</description>
    <pubDate>Mon, 11 Sep 2017 13:40:52 GMT</pubDate>
    <dc:creator>sphc</dc:creator>
    <dc:date>2017-09-11T13:40:52Z</dc:date>
    <item>
      <title>How can I create the same fields with different values within the same event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/328998#M166122</link>
      <description>&lt;P&gt;I need to extract cveid, cvss, vulnerability number, etc..&lt;/P&gt;

&lt;P&gt;here is my log:&lt;/P&gt;

&lt;P&gt;......&lt;BR /&gt;
cveid="1234"&lt;BR /&gt;
cvss= "abcd"&lt;BR /&gt;
.........&lt;BR /&gt;
cveid="34"&lt;BR /&gt;
cvss= "abdfd"&lt;BR /&gt;
.........&lt;BR /&gt;
cveid="153534"&lt;BR /&gt;
cvss= "abgdd"&lt;BR /&gt;
.........&lt;BR /&gt;
cveid="122344"&lt;BR /&gt;
cvss= "adfscd"&lt;/P&gt;

&lt;P&gt;.....................................&lt;/P&gt;

&lt;P&gt;and much more further in one event.&lt;/P&gt;

&lt;P&gt;thank you for your help&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 10:14:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/328998#M166122</guid>
      <dc:creator>sphc</dc:creator>
      <dc:date>2017-09-11T10:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create the same fields with different values within the same event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/328999#M166123</link>
      <description>&lt;P&gt;Which value belongs to which field in your log?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 12:56:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/328999#M166123</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-09-11T12:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create the same fields with different values within the same event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/329000#M166124</link>
      <description>&lt;P&gt;Log is look like :&lt;/P&gt;

&lt;P&gt;......&lt;BR /&gt;
cveid="1234"&lt;BR /&gt;
cvss= "abcd"&lt;BR /&gt;
.........&lt;BR /&gt;
cveid="34"&lt;BR /&gt;
cvss= "abdfd"&lt;BR /&gt;
.........&lt;BR /&gt;
cveid="153534"&lt;BR /&gt;
cvss= "abgdd"&lt;BR /&gt;
.........&lt;BR /&gt;
cveid="122344"&lt;BR /&gt;
cvss= "adfscd"&lt;/P&gt;

&lt;P&gt;and so on&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 13:40:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/329000#M166124</guid>
      <dc:creator>sphc</dc:creator>
      <dc:date>2017-09-11T13:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create the same fields with different values within the same event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/329001#M166125</link>
      <description>&lt;P&gt;As far as every &lt;CODE&gt;cveid&lt;/CODE&gt; has corresponding &lt;CODE&gt;cvss&lt;/CODE&gt; you can try the following approach:&lt;BR /&gt;
PS: First two pipes i.e. &lt;CODE&gt;makeresult&lt;/CODE&gt; and &lt;CODE&gt;eval&lt;/CODE&gt;are to mock data as per your question, you need to plug in commands from &lt;CODE&gt;rex&lt;/CODE&gt; onward to your existing base search:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  makeresults
|  eval _raw="......
cveid=\"1234\"
cvss= \"abcd\"
.........
cveid=\"34\"
cvss= \"abdfd\"
.........
cveid=\"153534\"
cvss= \"abgdd\"
.........
cveid=\"122344\"
cvss= \"adfscd\""
| rex "cveid=\"(?&amp;lt;cveid&amp;gt;[^\"]+)\"" max_match=0
| rex "cvss=\s\"(?&amp;lt;cvss&amp;gt;[^\"]+)\"" max_match=0
| table cveid cvss
| mvexpand cvss
| eval counter=1
| accum counter
| eval cveid=mvindex(cveid,counter-1)
| fields - counter
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Sep 2017 13:58:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/329001#M166125</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-09-11T13:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create the same fields with different values within the same event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/329002#M166126</link>
      <description>&lt;P&gt;The easiest way to do this is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | eval _raw="cveid=\"1234\"
cvss= \"abcd\"
cveid=\"34\"
cvss= \"abdfd\"
cveid=\"153534\"
cvss= \"abgdd\"
cveid=\"122344\"
cvss= \"adfscd\""

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| rex mode=sed "s/\s*=\s*/=/g"
| kv mv_add=t
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you can use &lt;CODE&gt;mvzip&lt;/CODE&gt; to join them together and &lt;CODE&gt;mvexpand&lt;/CODE&gt; to create separate events with joined-pairs (if that is what you need).&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 14:40:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/329002#M166126</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-09-11T14:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create the same fields with different values within the same event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/329003#M166127</link>
      <description>&lt;P&gt;@sphc, since you have upvoted both answers, requesting you to accept the one which you are using.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 10:53:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-the-same-fields-with-different-values-within/m-p/329003#M166127</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-09-13T10:53:28Z</dc:date>
    </item>
  </channel>
</rss>

