<?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: Need help on Search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149847#M41945</link>
    <description>&lt;P&gt;@lguinn, when I use outputcsv, I receive the data in following format:&lt;BR /&gt;
F1,F2,F3,&lt;BR /&gt;
"F1-Value1" "F1-Value2" "F1-Value3", &lt;BR /&gt;
"F2-Value1" "F2-Value2" "F2-Value1", &lt;BR /&gt;
"F3-Value1" "F3-Value2" "F3-Value3"&lt;/P&gt;

&lt;P&gt;Now how can I format the data in a way so that my java program can form the above XML by identifying the relation between the data? Do I need to add or remove something in my search query?&lt;/P&gt;

&lt;P&gt;Not sure if I gave you enough information, so please let me know if you still have confusions&lt;/P&gt;</description>
    <pubDate>Fri, 02 May 2014 07:46:35 GMT</pubDate>
    <dc:creator>pramit46</dc:creator>
    <dc:date>2014-05-02T07:46:35Z</dc:date>
    <item>
      <title>Need help on Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149844#M41942</link>
      <description>&lt;P&gt;This question is related to &lt;A href="http://answers.splunk.com/answers/133330/subquery-does-not-return-any-result"&gt;'This'&lt;/A&gt; one. I wanted to extract multiple fields from different sourcetypes and indexes and print them.&lt;BR /&gt;&lt;BR /&gt;
Field1(F1) &amp;amp; Field2(F2) (belong to Sourcetype S1) and Field (F3) (belongs to Sourcetype S2). All the fields are multivalued.&lt;/P&gt;

&lt;P&gt;Now, I want pass the data to a java program which would transform the data into an XML. for example, in the following format: &lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
&amp;lt;Data&amp;gt;&lt;BR /&gt;
  &amp;lt;F1-Value1&amp;gt;&lt;BR /&gt;
    &amp;lt;F2-Value1/&amp;gt;&lt;BR /&gt;
    &amp;lt;F3-Value1/&amp;gt;&lt;BR /&gt;
  &amp;lt;/F1-Value1&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
  &amp;lt;F1-Value2&amp;gt;&lt;BR /&gt;
    &amp;lt;F2-Value2/&amp;gt;&lt;BR /&gt;
    &amp;lt;F3-Value2/&amp;gt;&lt;BR /&gt;
  &amp;lt;/F1-Value2&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
  &amp;lt;F1-Value3&amp;gt;&lt;BR /&gt;
   //No respective data for the value3&lt;BR /&gt;
  &amp;lt;/F1-Value3&amp;gt;&lt;BR /&gt;
&amp;lt;/Data&amp;gt;&lt;BR /&gt;
&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;In the output CSV file, I see that Splunk prints all the distinct values while I run the search. But I need all the values to be passed and in a way so that the java program is able to identify the relation among the values of F1, F2 &amp;amp; F3 while creating the XML.&lt;/P&gt;

&lt;P&gt;What is the best way to gather the above data in Splunk? How can I list all the values of these fields (including the duplicates) and also indicate the java program about the relation between the fields so that it can form the XML?&lt;/P&gt;

&lt;P&gt;I know this question is a little complicated to understand. Please let me know if you need more clarification.&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 06:12:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149844#M41942</guid>
      <dc:creator>pramit46</dc:creator>
      <dc:date>2014-05-02T06:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149845#M41943</link>
      <description>&lt;P&gt;What IS the relationship between F1 and F2 and F3? I expect that F1 and F2 will occur in the same event, since they are both of sourcetype1, so I can see that relationship. But how does F3 fit in? What is the relationship between sourcetype1 and sourcetype2?&lt;/P&gt;

&lt;P&gt;I don't think this is a complicated question, but I think you need to give more details. Perhaps you should show data that is not so abstract...&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 07:02:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149845#M41943</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-05-02T07:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149846#M41944</link>
      <description>&lt;P&gt;@lguinn, Unfortunately I cannot show you the actual data, so I'll try to put a relevant example.&lt;BR /&gt;
I have some logs coming in from one subsystems which may be linked with the logs generated from other subsystems (may be by input file name or some other fields).&lt;BR /&gt;
Now, all the sub-systems process the input file differently and store different fields in the respective logs. Thus, the values of F1 &amp;amp; F2 extracted from S1 may or may not be related to the value of F3 coming from S2.&lt;BR /&gt;
But from the input filename, I can identify which values are related to that filename and put them in the same XML block.&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 07:32:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149846#M41944</guid>
      <dc:creator>pramit46</dc:creator>
      <dc:date>2014-05-02T07:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149847#M41945</link>
      <description>&lt;P&gt;@lguinn, when I use outputcsv, I receive the data in following format:&lt;BR /&gt;
F1,F2,F3,&lt;BR /&gt;
"F1-Value1" "F1-Value2" "F1-Value3", &lt;BR /&gt;
"F2-Value1" "F2-Value2" "F2-Value1", &lt;BR /&gt;
"F3-Value1" "F3-Value2" "F3-Value3"&lt;/P&gt;

&lt;P&gt;Now how can I format the data in a way so that my java program can form the above XML by identifying the relation between the data? Do I need to add or remove something in my search query?&lt;/P&gt;

&lt;P&gt;Not sure if I gave you enough information, so please let me know if you still have confusions&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 07:46:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149847#M41945</guid>
      <dc:creator>pramit46</dc:creator>
      <dc:date>2014-05-02T07:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149848#M41946</link>
      <description>&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=S1 OR sourcetype=S2
| stats list(F1) as F1 list(F2) as F2 list(F3) as F3 by inputFilename
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might add this at the end&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Fields = mvzip( mvzip(F1,F2,","),F3,",")
| fields - F1 F2 F3 inputFilename
| mvexpand Fields
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 May 2014 20:32:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149848#M41946</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-05-02T20:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149849#M41947</link>
      <description>&lt;P&gt;Thanks @lguinn, it worked. But I guess, if you can help me with one more thing, I should be in a good shape. &lt;BR /&gt;
Suppose, I'm publishing 15 fields (columns) in my search result, is there any way I can club certain columns together and give them a logical name? for example: If I have (mv)fields F1-F15 in output, now along with them, can I also print the following logical fields L1(by clubbing F1, F9, F13), L2(by clubbing F1, F9, F10), L3(by clubbing F4, F8, F13).&lt;BR /&gt;
Please note that I have certain (actual) fields common in the values of logical fields.&lt;BR /&gt;
Can I use mvzip/mvexpand for these?&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2014 13:22:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-on-Search/m-p/149849#M41947</guid>
      <dc:creator>pramit46</dc:creator>
      <dc:date>2014-05-05T13:22:52Z</dc:date>
    </item>
  </channel>
</rss>

