/// <summary>
        /// The main program
        /// </summary>
        /// <param name="argv">The command line arguments</param>
        static async Task Run(Service service)
        {
            Console.WriteLine("Login as admin");
            string username = "******";
            string password = "******";
            await service.LoginAsync(username, password);

            Console.WriteLine("create a  index");
            string indexName = "user-index";
            string source = "*\\splunkd.log";
            string sourceType = "splunkd";

            if (service.GetIndexesAsync().Result.Any(a => a.Name == indexName))
            {
                await service.RemoveIndexAsync(indexName);
            }

            Index index = await service.CreateIndexAsync(indexName);
            try
            {
                await index.EnableAsync();

                Receiver receiver = service.Receiver;
                ReceiverArgs args = new ReceiverArgs()
                {
                    Index = indexName,
                    Source = source,
                    SourceType = sourceType,
                };

                await receiver.SendAsync("Hello World.", args);
                await receiver.SendAsync("Goodbye world.", args);

                SearchResults results = service.SearchOneshotAsync(
                    string.Format(
                        "search index={0}",// source={2} sourcetype={3}",
                        indexName
                        //source,
                        //sourceType
                        )).Result;

                Console.WriteLine(results);              
            }
            finally
            {
                service.RemoveIndexAsync(indexName).Wait();
            }
        }