<?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: What is the best way to spoof run-anywhere fake data for a question? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192341#M221377</link>
    <description>&lt;P&gt;I frequently do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count | eval field = "val1 val2 val3" | makemv field | mvexpand field
| eval mv = "mv1 mv2 mv3" | makemv mv
| streamstats count | eval val = random()%100
| eval _time = now() + random()%100 | sort - _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Gives you five things:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;three events to play with&lt;/LI&gt;
&lt;LI&gt;single- and multi-value fields&lt;/LI&gt;
&lt;LI&gt;a count or id&lt;/LI&gt;
&lt;LI&gt;numerical data&lt;/LI&gt;
&lt;LI&gt;timestamps&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Pick what you need and re-assemble for each sample data task.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jul 2015 05:16:27 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2015-07-07T05:16:27Z</dc:date>
    <item>
      <title>What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192338#M221374</link>
      <description>&lt;P&gt;Many people ask questions here that are tricky enough that the only way to get an answer that works is to play around with the data quite a bit.  In order to do this, we have to fake data first.  For the following data set, what is the best way to do it?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host   source  count name
host1  sourceA 33    Inky
host2  sourceA 23    Pinky
host3  sourceB -2    Blinky
host4           5    Clyde
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What about for &lt;CODE&gt;multi-value&lt;/CODE&gt; fields?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2015 04:27:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192338#M221374</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-07T04:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192339#M221375</link>
      <description>&lt;P&gt;A combination of _internal, eventgen, and the Windows or NIX TA.&lt;/P&gt;

&lt;P&gt;These can cover most all general questions and functionality of Splunk Search related questions. There almost examples of almost all kinds of datasets included in these, and pouring over these is a great way to learn Splunk.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2015 04:33:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192339#M221375</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-07-07T04:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192340#M221376</link>
      <description>&lt;P&gt;"Best" is rather subjective, and varies widely with the question being asked. However I try to use the most straightforward method as needed for a particular problem. In your example case As you gave sample data in a tabular form I would use &lt;CODE&gt;|noop|stats count&lt;/CODE&gt; to get a single result record, followed by eval to paste in your table as &lt;CODE&gt;_raw&lt;/CODE&gt; then use &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/multikv"&gt;multikv&lt;/A&gt; to split into records and fields. As I previously pointed out &lt;A href="http://answers.splunk.com/comments/266516/view.html"&gt;in a comment&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Multivalve fields would handle no differently, just pick a delimiter that doesn't appear elsewhere and serialize multivalued fields with it and after multikv, use eval with the split function to make your mv field. (I used a similar principle in &lt;A href="http://answers.splunk.com/answers/248141/how-to-do-stats-or-top-for-each-colunm-in-a-table.html"&gt;the original part of this answer&lt;/A&gt; encoding multivalued fields as single valued fields with *** as a delimiter)&lt;/P&gt;

&lt;P&gt;When data isn't provided using &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/gentimes"&gt;gentimes&lt;/A&gt; can generate a bunch of time slots quickly. A few evals making use of random() with appropriate math to constrain ranges and you have magically generated massive sets of data. Using summary indexing commands and temporary indexes then let's you keep that generated set and see what manipulation scan be done.&lt;/P&gt;

&lt;P&gt;Another method I've used was to take a string, split it into a multivalued field, mvexpand and then used auto extraction. &lt;A href="https://gist.github.com/acharlieh/8cf7087ffd15b5ca8945"&gt;in this gist&lt;/A&gt;. I don't remember if I generated or was given that data.&lt;/P&gt;

&lt;P&gt;But in short, there is no best way, use the many tools of Splunk and do whatever is easiest for the problem at hand.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2015 05:05:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192340#M221376</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-07-07T05:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192341#M221377</link>
      <description>&lt;P&gt;I frequently do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count | eval field = "val1 val2 val3" | makemv field | mvexpand field
| eval mv = "mv1 mv2 mv3" | makemv mv
| streamstats count | eval val = random()%100
| eval _time = now() + random()%100 | sort - _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Gives you five things:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;three events to play with&lt;/LI&gt;
&lt;LI&gt;single- and multi-value fields&lt;/LI&gt;
&lt;LI&gt;a count or id&lt;/LI&gt;
&lt;LI&gt;numerical data&lt;/LI&gt;
&lt;LI&gt;timestamps&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Pick what you need and re-assemble for each sample data task.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2015 05:16:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192341#M221377</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-07T05:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192342#M221378</link>
      <description>&lt;P&gt;I typically do something very similar to @martin_mueller like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts | head 1 | eval name="Inky Pinky Blinky Clyde" makemv name | mvexpand name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gives me my 4 events and it does it quickly because nothing is faster than "head 1" (I think).&lt;BR /&gt;
Now I can set my other fields' values with case statements like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval host=case(name="Inky", host1, name="Pinky", host2, name="Blinky", host3, name="Clyde", host4)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jul 2015 05:29:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192342#M221378</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-07T05:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192343#M221379</link>
      <description>&lt;P&gt;Technically, this is much faster than &lt;CODE&gt;| head 1&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| noop | stats count | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can't get faster than not even loading one event...&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2015 06:50:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192343#M221379</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-07T06:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192344#M221380</link>
      <description>&lt;P&gt;Accept that you don't need the &lt;CODE&gt;noop&lt;/CODE&gt; part:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count | ....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Oct 2015 13:37:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192344#M221380</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-02T13:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192345#M221381</link>
      <description>&lt;P&gt;Need? Maybe not, but talking in terms of pure speed.... It's been a while since I did this experiment, but use the job inspector and compare performance metrics of  &lt;CODE&gt;| stats count&lt;/CODE&gt; and &lt;CODE&gt;|noop | stats count&lt;/CODE&gt; if I remember correctly, in a distributed environment the former is actually distributing a search (that happens to return nothing from anywhere), but the latter literally does nothing and counts it. So the former is impacted by connectivity to indexers, and the latter is not. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 14:02:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192345#M221381</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-10-02T14:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192346#M221382</link>
      <description>&lt;P&gt;Brilliant; I would not have even thought to check this!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 15:39:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192346#M221382</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-02T15:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192347#M221383</link>
      <description>&lt;P&gt;Small update, since 6.3 there is a dedicated command to make artificial results: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/SearchReference/Makeresults"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/SearchReference/Makeresults&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 22:48:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192347#M221383</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-12-13T22:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192348#M221384</link>
      <description>&lt;P&gt;There is a new command for this that can be used instead of &lt;CODE&gt;|noop|stats count AS ...&lt;/CODE&gt;, it is &lt;CODE&gt;|makeresults&lt;/CODE&gt;:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Makeresults"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Makeresults&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 19:14:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/192348#M221384</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-29T19:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/638900#M221385</link>
      <description>&lt;P&gt;The best way is like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="
host   source  count name
host1  sourceA 33    Inky
host2  sourceA 23    Pinky
host3  sourceB -2    Blinky
host4           5    Clyde"
| multikv forceheader=1&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 05 Apr 2023 21:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/638900#M221385</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2023-04-05T21:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to spoof run-anywhere fake data for a question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/638903#M221386</link>
      <description>&lt;P&gt;It is a nice way but it works great only if you're copy-pasting from somewhere. If you're producing data by hand this way, you need all this spaces counting. I'd rather do a simple json and then spath/mvexpand if needed. But I usually generate data with something like for example&lt;/P&gt;&lt;PRE&gt;| makeresults count=100&lt;BR /&gt;| streamstats count&lt;BR /&gt;| eval fieldA=count % 12&lt;BR /&gt;| eval fieldB=count % 7&lt;BR /&gt;| [... and so on ...]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 21:23:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-spoof-run-anywhere-fake-data-for-a/m-p/638903#M221386</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-04-05T21:23:07Z</dc:date>
    </item>
  </channel>
</rss>

