<?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 split up multiple values within a field (mvexpand) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-multiple-values-within-a-field-mvexpand/m-p/463889#M130760</link>
    <description>&lt;P&gt;is this 1 event or 3?&lt;BR /&gt;
if its 1 event you should be breaking your event &lt;BR /&gt;
if its 3 events use &lt;CODE&gt;|eventstats dc(component) AS condition | table target condition msglog component&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Aug 2019 15:16:27 GMT</pubDate>
    <dc:creator>diogofgm</dc:creator>
    <dc:date>2019-08-26T15:16:27Z</dc:date>
    <item>
      <title>How to split up multiple values within a field (mvexpand)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-multiple-values-within-a-field-mvexpand/m-p/463886#M130757</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;The output of both systems is written to the same index and differ by the component contained in the event.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;e.g:&lt;/EM&gt;&lt;BR /&gt;
user=x component=old target=foobar&lt;BR /&gt;
OR&lt;BR /&gt;
user=x component=new target=foobar&lt;BR /&gt;
|stats dc(component) as condition, list(msglog) as msglog, list(component) as component&lt;BR /&gt;&lt;BR /&gt;
| where condition&amp;gt;1  &lt;/P&gt;

&lt;P&gt;I have a data that looks like this:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;|target    |condition    |msglog                                   |component&lt;/STRONG&gt;&lt;BR /&gt;
    |footbar      | 2                   |Registration successful      |old&lt;BR /&gt;
    |                     |                    |Registration successful      |new&lt;BR /&gt;
    |                 |                    |invalid login                    |new&lt;/P&gt;

&lt;P&gt;A field is grouped into multiple fields (example "msglog", "Date", "component" . However, I want to extract them all separately in one field and list them in a table by targetID.  The result should look like this:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;|target    |condition    |msglog                                   |component&lt;/STRONG&gt;&lt;BR /&gt;
    |footbar      | 2                   |Registration successful      |old&lt;BR /&gt;
    |footbar      | 2                 |Registration successful   |new&lt;BR /&gt;
    |footbar      | 2                 |invalid login                     |new&lt;/P&gt;

&lt;P&gt;BUT, if i use &lt;STRONG&gt;mvexpand&lt;/STRONG&gt;:&lt;BR /&gt;
...| mvexpand msglog&lt;BR /&gt;
| fillnull msglog value=0&lt;BR /&gt;
| mvexpand component&lt;BR /&gt;
| fillnull component value=0&lt;BR /&gt;
| dedup msglog component&lt;/P&gt;

&lt;P&gt;There is an additional field with msglog=invalid login with component=old, which is not correct. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;|target    |condition    |msglog                                           |component&lt;/STRONG&gt;&lt;BR /&gt;
    |footbar      | 2                   |Registration successful         |old&lt;BR /&gt;
    |footbar      | 2                 |Registration successful       |new&lt;BR /&gt;
    |footbar      | 2                 |invalid login                             |new&lt;BR /&gt;
    &lt;EM&gt;|footbar     | 2                 |invalid login                         |old&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Thanks for your Help and your Time&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 11:19:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-multiple-values-within-a-field-mvexpand/m-p/463886#M130757</guid>
      <dc:creator>mklhs</dc:creator>
      <dc:date>2019-08-26T11:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to split up multiple values within a field (mvexpand)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-multiple-values-within-a-field-mvexpand/m-p/463887#M130758</link>
      <description>&lt;P&gt;mvexpand will expand that particular field and copy the others that's why when you expand "&lt;STRONG&gt;msglog&lt;/STRONG&gt;" both "Registration successful" and "invalid login" will have then a mv field "&lt;STRONG&gt;component&lt;/STRONG&gt;" with both "new" and "old" values for each "&lt;STRONG&gt;msglog&lt;/STRONG&gt;" value&lt;/P&gt;

&lt;P&gt;does each event has every field? target, condition, msglog, component&lt;BR /&gt;
because from what I see there is no way (with your search) you could have those results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;user=x component=old target=foobar
OR
user=x component=new target=foobar
|stats dc(component) as condition, list(msglog) as msglog, list(component) as component
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;target won't be an available field in the results here. Only condition, msglog, component.&lt;BR /&gt;
Can you post some raw data?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 12:35:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-multiple-values-within-a-field-mvexpand/m-p/463887#M130758</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2019-08-26T12:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to split up multiple values within a field (mvexpand)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-multiple-values-within-a-field-mvexpand/m-p/463888#M130759</link>
      <description>&lt;P&gt;Hello @diogofgm &lt;BR /&gt;
Here are the raw data:&lt;/P&gt;

&lt;P&gt;{"timestamp":"2019-07-12T20:48:08.371+02:00",&lt;BR /&gt;
"user":"x",&lt;BR /&gt;
"component":"new",&lt;BR /&gt;
"target":"footbar",&lt;BR /&gt;
"msglog":"invalid login"&lt;BR /&gt;
}&lt;BR /&gt;
..........&lt;BR /&gt;
{"timestamp":"2019-07-12T20:48:08.25+02:00",&lt;BR /&gt;
"user":"x",&lt;BR /&gt;
"component":"old",&lt;BR /&gt;
"target":"footbar",&lt;BR /&gt;
"msglog":"Registration successful"&lt;BR /&gt;
}&lt;BR /&gt;
...........&lt;/P&gt;

&lt;P&gt;{"timestamp":"2019-07-12T20:48:08.184+02:00",&lt;BR /&gt;
"user":"x",&lt;BR /&gt;
"component":"new",&lt;BR /&gt;
"target":"footbar",&lt;BR /&gt;
"msglog":"Registration successful"&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;As I said, 1 field has several values ​​in one row (&lt;BR /&gt;
i.e. the value has "msglog"&lt;BR /&gt;
"Registration successful"&lt;BR /&gt;
"Registration successful"&lt;BR /&gt;
"invalid login"). I would like to have these values ​​in a table in a separate line extracted so that the results are correct. Otherwise, I can not limit my results, for example, only to "Registration successful"&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 13:27:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-multiple-values-within-a-field-mvexpand/m-p/463888#M130759</guid>
      <dc:creator>mklhs</dc:creator>
      <dc:date>2019-08-26T13:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to split up multiple values within a field (mvexpand)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-multiple-values-within-a-field-mvexpand/m-p/463889#M130760</link>
      <description>&lt;P&gt;is this 1 event or 3?&lt;BR /&gt;
if its 1 event you should be breaking your event &lt;BR /&gt;
if its 3 events use &lt;CODE&gt;|eventstats dc(component) AS condition | table target condition msglog component&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 15:16:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-multiple-values-within-a-field-mvexpand/m-p/463889#M130760</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2019-08-26T15:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to split up multiple values within a field (mvexpand)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-multiple-values-within-a-field-mvexpand/m-p/463890#M130761</link>
      <description>&lt;P&gt;Just do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;You should always specify index&amp;gt; AND sourcetype=&amp;lt;And sourcetype too&amp;gt;
| table target condition msglog component
| filldown target
| filldown condition
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Aug 2019 15:28:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-multiple-values-within-a-field-mvexpand/m-p/463890#M130761</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-08-26T15:28:28Z</dc:date>
    </item>
  </channel>
</rss>

